Last active
April 12, 2016 21:22
-
-
Save DannyDelott/cf6e51c02eb660dab9d6a93dcbfdf75d to your computer and use it in GitHub Desktop.
Pre-commit hook
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 | |
for staged_file in $(git diff --cached --name-only) | |
do | |
if [[ "$staged_file" == *\.js$* ]] && [ -f "$staged_file" ]; then | |
./node_modules/jscs/bin/jscs "$staged_file" | |
if [[ "$?" != "0" ]]; then | |
exit 1 | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment