Guest User

Untitled

a guest
May 26th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # This file should be placed in the .git/hooks folder.
  4. # Typescript-formatted should be installed if you don't already have it
  5. # (npm install -g typescript-formatter)
  6. #
  7. # Called by "git commit" with no arguments. The hook should
  8. # exit with non-zero status after issuing an appropriate message if
  9. # it wants to stop the commit.
  10. #
  11. # Runs typescript-formatter on all staged files
  12.  
  13. echo 'Running tsfmt'
  14. git diff --name-only --cached | grep '\.ts' | while read line ; do
  15. tsfmt -r $line
  16. git add $line
  17. done
Add Comment
Please, Sign In to add comment