Last active
December 30, 2015 08:58
-
-
Save james-huston/7805716 to your computer and use it in GitHub Desktop.
Git pre-commit hook for lint checking with grunt before allowing a commit. Add it as an install script to your package.json.
This file contains hidden or 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/bash | |
if [ ! -f .git/hooks/pre-commit ] | |
then | |
echo "Adding pre-commit hook" | |
echo "#!/bin/sh" > .git/hooks/pre-commit | |
echo "grunt jshint; exit \$?" >> .git/hooks/pre-commit | |
chmod ug+x .git/hooks/pre-commit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment