Created
October 24, 2013 10:38
-
-
Save andreychev/7134901 to your computer and use it in GitHub Desktop.
precommit-hook
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 | |
echo "\nStarting Grunt tests" | |
# Lint catalog js files with grunt.js | |
grunt catalog | |
RETVAL=$? | |
[ $RETVAL -eq 0 ] && echo Success | |
[ $RETVAL -ne 0 ] && echo Failure | |
if [ $RETVAL -ne 0 ] | |
then | |
echo "Grunt tests failed: commit prevented" | |
exit 1 | |
else | |
echo "Grunt passed > commit enabled" | |
exit 0 | |
fi | |
echo "All done! Now you can push" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment