Skip to content

Instantly share code, notes, and snippets.

@gish
Created November 12, 2012 15:33
Show Gist options
  • Save gish/4059989 to your computer and use it in GitHub Desktop.
Save gish/4059989 to your computer and use it in GitHub Desktop.
JSHint pre-commit hook
#!/bin/bash
cd $(git rev-parse --show-toplevel)
# JSHINT
echo -n "Jshint..."
JSHINTRESULT=`jshint .`
JSHINT=$?
if [ $JSHINT != 0 ]
then
echo "failed!"
echo $JSHINTRESULT
exit $JSHINT
else
echo "lint free!"
fi
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment