Created
April 17, 2015 14:40
-
-
Save boxxxie/c63ae3018dc47a73f8e9 to your computer and use it in GitHub Desktop.
jshint git hook
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
#!/bin/bash | |
echo running pre-push hook for jshint | |
# Make a temp directory for writing the .jshintrc file | |
TMP_DIR=`mktemp -d` | |
EXIT_CODE=0 | |
# Run JSHint on the file and redirect the output back to Git | |
jshint `git root` >&2 | |
# Capture the exit status of last command | |
EXIT_CODE=$((${EXIT_CODE} + $?)) | |
exit $EXIT_CODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git config --global --add alias.root '!pwd'
http://stackoverflow.com/a/1890014/636603