Last active
February 9, 2017 13:50
-
-
Save enVolt/d7baeb16dcb330c0a1e19d324c8f64f6 to your computer and use it in GitHub Desktop.
Pre-commit hook for Node.js Project
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 | |
npm run eslint | |
RESULT=$? | |
echo $RESULT | |
[ $RESULT -ne 0 ] && exit 1 | |
npm test | |
RESULT=$? | |
[ $RESULT -ne 0 ] && exit 1 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
File location
<ProjectDirectory>/.git/hooks/pre-commit
Change file mod to executable (
chmod +x ./.git/hooks/pre-commit
)