Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # This file should be placed in the .git/hooks folder.
- # Typescript-formatted should be installed if you don't already have it
- # (npm install -g typescript-formatter)
- #
- # Called by "git commit" with no arguments. The hook should
- # exit with non-zero status after issuing an appropriate message if
- # it wants to stop the commit.
- #
- # Runs typescript-formatter on all staged files
- echo 'Running tsfmt'
- git diff --name-only --cached | grep '\.ts' | while read line ; do
- tsfmt -r $line
- git add $line
- done
Add Comment
Please, Sign In to add comment