Created
April 23, 2020 03:03
-
-
Save luchiago/414bd3486dfd137d3d1c6a8fbeac9aa7 to your computer and use it in GitHub Desktop.
Hook for pre-push
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
// pre-push | |
#!/usr/bin/env bash | |
echo "Running pre-push hook" | |
./scripts/run-brakeman.bash | |
./scripts/run-tests.bash | |
# $? stores exit value of the last command | |
if [ $? -ne 0 ]; then | |
echo "Brakeman and Tests must pass before pushing!" | |
exit 1 | |
fi | |
// run-brakeman.bash | |
#!/usr/bin/env bash | |
set -e | |
cd "${0%/*}/../.." | |
echo "Running brakeman" | |
bundle exec brakeman | |
// run-tests.bash | |
#!/usr/bin/env bash | |
set -e | |
cd "${0%/*}/../.." | |
echo "Running rspec" | |
bundle exec rspec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment