Skip to content

Instantly share code, notes, and snippets.

@JMPerez
Created January 4, 2013 10:21
Show Gist options
  • Save JMPerez/4451511 to your computer and use it in GitHub Desktop.
Save JMPerez/4451511 to your computer and use it in GitHub Desktop.
Javascript pre-commit hook
#!/bin/sh
files=$(git diff-index --name-only HEAD | grep -l '\.js$')
for file in $files; do
esvalidate $file
if [ $? -eq 1 ]; then
echo "Syntax error: $file"
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment