Skip to content

Instantly share code, notes, and snippets.

@boxxxie
Created April 17, 2015 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxxxie/c63ae3018dc47a73f8e9 to your computer and use it in GitHub Desktop.
Save boxxxie/c63ae3018dc47a73f8e9 to your computer and use it in GitHub Desktop.
jshint git hook
#!/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
@boxxxie
Copy link
Author

boxxxie commented Apr 17, 2015

git config --global --add alias.root '!pwd'
http://stackoverflow.com/a/1890014/636603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment