Skip to content

Commit 1d85103

Browse files
committed
fix: silence all the pointless githook warnings and logs in make-env
1 parent cb47697 commit 1d85103

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

make-everyvoice-env

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,20 @@ echo "Environment creation completed with success"
243243

244244
echo ""
245245
echo "Configuring your sandbox in case you want to contribute to the project."
246-
if ! pre-commit install; then
247-
echo "Error running \"pre-commit install\". Your \"$ENV2ACTIVATE\" environment is good, but if you want to submit contributions to the project, please rerun \"pre-commit install\" in your sandbox."
246+
if [[ ! -f .git/hooks/pre-commit ]]; then
247+
if ! pre-commit install; then
248+
echo "Error running \"pre-commit install\". Your \"$ENV2ACTIVATE\" environment is good, but if you want to submit contributions to the project, please rerun \"pre-commit install\" in your sandbox."
249+
fi
248250
fi
249-
if ! gitlint install-hook; then
250-
echo ""
251-
echo "Error running \"gitlint install-hook\". Your \"$ENV2ACTIVATE\" environment is good, but if you want to submit contributions to the project, please rerun \"gitlint install-hook\" in your sandbox."
251+
if [[ ! -f .git/hooks/commit-msg ]]; then
252+
if ! gitlint install-hook; then
253+
echo ""
254+
echo "Error running \"gitlint install-hook\". Your \"$ENV2ACTIVATE\" environment is good, but if you want to submit contributions to the project, please rerun \"gitlint install-hook\" in your sandbox."
255+
fi
252256
fi
253257
# Try to install pre-commit and gitlint hooks in the submodules but don't complain on failure
254-
git submodule foreach 'pre-commit install || true' || true
255-
git submodule foreach 'gitlint install-hook || true' || true
258+
git submodule foreach 'pre-commit install || true' >& /dev/null || true
259+
git submodule foreach 'gitlint install-hook || true' >& /dev/null || true
256260

257261
echo ""
258262
echo "SUCCESS!"

0 commit comments

Comments
 (0)