Last active
December 25, 2015 15:19
-
-
Save willread/6997271 to your computer and use it in GitHub Desktop.
Pre-commit test running via git hooks and npm.
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
#!/usr/bin/env bash | |
NUM_ERRORS=`npm test | grep -c ERR` | |
if [ $NUM_ERRORS -ne 0 ] | |
then | |
echo -e "One or more tests failed, commit aborted" | |
exit 1 | |
else | |
echo -e "All tests passed, proceeding with commit" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment