Created
January 3, 2012 16:53
-
-
Save guillermo/1555759 to your computer and use it in GitHub Desktop.
javascript syntax check for a git pre-commit
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 | |
for js in $(git diff-index --name-only HEAD); do | |
echo Checking $js | |
if ( [ -f $js ] ); then | |
if jsl --process $js > /dev/null ; then | |
echo $js | |
else | |
echo "js files failed $js" | |
jsl -nologo -nofilelisting -nosummary --process $js | |
exit 1 | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment