Skip to content

Instantly share code, notes, and snippets.

@andreychev
Created October 24, 2013 10:38
Show Gist options
  • Save andreychev/7134901 to your computer and use it in GitHub Desktop.
Save andreychev/7134901 to your computer and use it in GitHub Desktop.
precommit-hook
#!/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