Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. files=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.tsx?$")
  4. if [ "$files" = "" ]; then
  5. exit 0
  6. fi
  7.  
  8. pass=true
  9.  
  10. for file in ${files}; do
  11. result=$(./node_modules/.bin/tslint ${file})
  12. if [[ $result != "" ]]; then
  13. pass=false
  14. echo $result
  15. fi
  16. done
  17.  
  18. if ! $pass; then
  19. echo "\033[91mCOMMIT FAILED:\033[0m Your commit contains files that should pass TSLint but do not. Please fix the TSLint errors and try again."
  20. exit 1
  21. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement