Skip to content

Instantly share code, notes, and snippets.

@otterthecat
Created February 10, 2014 02:58
Show Gist options
  • Save otterthecat/8909615 to your computer and use it in GitHub Desktop.
Save otterthecat/8909615 to your computer and use it in GitHub Desktop.
git pre-commit hook to run grunt
#!/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