Last active
September 24, 2021 07:49
-
-
Save DanielShterenberg/5f9681cceb11c3afe508705b5fb41bfb to your computer and use it in GitHub Desktop.
Creating a pre-push Git hook which will run multiple hooks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd "$(dirname "$0")/pre-push.d" | |
for hook in *; do | |
bash $hook | |
RESULT=$? | |
if [ $RESULT != 0 ]; then | |
echo "pre-push.d/$hook returned non-zero: $RESULT, abort commit" | |
exit $RESULT | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment