Created
September 18, 2015 17:59
-
-
Save threewordphrase/d859a4430c93c0dc2bd3 to your computer and use it in GitHub Desktop.
RSpec pre-push git hook
This file contains hidden or 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
echo "Running RSpec" | |
bundle exec rake spec | |
spec=$? | |
if [ $spec -eq 0 ]; then | |
osascript -e 'display notification "Tests have passed, pushing" with title "EMT Specs"' | |
echo "\\033[32mTests are green, pushing...\\033[0;39m" | |
exit 0 | |
else | |
osascript -e 'display notification "Tests have failed, stopping push" with title "EMT Specs"' | |
echo "\\033[1;31mCannot push, tests are failing. Use --no-verify to force push.\\033[0;39m" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment