Skip to content

Instantly share code, notes, and snippets.

@guillermo
Created January 3, 2012 16:53
Show Gist options
  • Save guillermo/1555759 to your computer and use it in GitHub Desktop.
Save guillermo/1555759 to your computer and use it in GitHub Desktop.
javascript syntax check for a git pre-commit
#!/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