Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. svn-repo
  2. branches
  3. hooks
  4. pre-commit.sh
  5. tags
  6. trunk
  7. scripts
  8. script.js
  9. index.html
  10. .jshintrc
  11.  
  12. ROOT_DIR=$(git rev-parse --show-toplevel) # gets the path of this repo
  13. CONF="--config=${ROOT_DIR}/build/config/jshint.json" # path of your jshint config
  14. JSHINT=$(which jshint) # jshint path
  15.  
  16. if git rev-parse --verify HEAD >/dev/null 2>&1; then
  17. against=HEAD
  18. else
  19. # Initial commit: diff against an empty tree object
  20. against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
  21. fi
  22.  
  23.  
  24. for file in $(git diff-index --name-only ${against} -- | egrep .js); do
  25. if $JSHINT $file ${CONF} 2>&1 | grep 'No errors found' ; then
  26. echo "jslint passed ${file}"
  27. exit 0
  28. else
  29. $JSHINT $file
  30. exit 1
  31. fi
  32. done
  33.  
  34. /usr/local/bin/jshint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement