Created
February 27, 2014 19:55
-
-
Save calebhaye/9258126 to your computer and use it in GitHub Desktop.
Run tests before git 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
#!/bin/sh | |
branch=`git rev-parse --abbrev-ref HEAD` | |
echo "Running tests before pushing ...." | |
if [ $branch == 'master' ]; then | |
exit_code=$(bundle exec rake > /dev/null 2>/dev/null )$? | |
if [ $exit_code -gt 0 ] | |
then echo "Did not push because of failing tests" | |
fi | |
exit $exit_code | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment