Created
February 10, 2014 02:58
-
-
Save otterthecat/8909615 to your computer and use it in GitHub Desktop.
git pre-commit hook to run grunt
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 | |
grunt | |
RETVAL=$? | |
[ $RETVAL -eq 0 ] && echo Success | |
[ $RETVAL -ne 0 ] && echo Failure | |
if [ $RETVAL -ne 0 ] | |
then | |
echo "Grunt task(s) failed: commit prevented" | |
exit 1 | |
else | |
echo "Grunt task(s) PASSED!! Whoo hoo, Mountain Dew!" | |
echo "Commit Accepted" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment