Forked from ssaunier/git-pre-push-hook-install.sh
Last active
August 29, 2015 14:23
-
-
Save frankyston/6789bd0a4f24343b55de to your computer and use it in GitHub Desktop.
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
cd /path/to/your/repo | |
curl https://gist.github.com/ssaunier/8704755/raw/pre-push.sh > .git/hooks/pre-push | |
chmod u+x .git/hooks/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
echo "Running RSpec" | |
bundle exec rspec spec | |
spec=$? | |
#echo "Running Karma" | |
#bundle exec rake karma:run | |
#karma=$? | |
# if use spec and karma | |
# if [ $spec -eq 0 ] && [ $karma -eq 0 ]; then | |
if [ $spec -eq 0 ] then | |
echo "\\033[32mTests are green, pushing...\\033[0;39m" | |
exit 0 | |
else | |
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