Created
November 22, 2013 21:02
-
-
Save kinncj/7606816 to your computer and use it in GitHub Desktop.
run JSLint for all changed js files
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/bash | |
JSLINT="jslint --indent 4 --white true" | |
for file in $(git status | grep -P '\.((js)|(html)|(json))$'); do | |
if node $JSLINT $file 2>&1 | grep 'No errors found' ; then | |
echo "jslint passed ${file}" | |
exit 0 | |
else | |
node $JSLINT $file | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment