Skip to content

Instantly share code, notes, and snippets.

@treelite
Last active August 29, 2015 13:57
Show Gist options
  • Save treelite/9509895 to your computer and use it in GitHub Desktop.
Save treelite/9509895 to your computer and use it in GitHub Desktop.
git pre-commit hook
#!/bin/bash
#
# path: .git/hooks/pre-commit
echo "\n\x1B[33mCommit checking ...\x1B[0m\n"
npm test
exitCode=$?
if [ $exitCode -ne 0 ]
then
echo "\n\x1B[31mUT fail, abort commit\x1B[0m\n"
fi
exit $exitCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment