tridactyl/hooks/pre-commit

10 lines
216 B
Text
Raw Normal View History

2018-03-06 22:03:44 +01:00
#!/bin/sh
# Run prettier on the diffs
2018-04-13 19:41:22 +01:00
$(npm bin)/precise-commits
2018-03-06 22:03:44 +01:00
# Re-add the modified files
2018-04-14 11:46:31 +01:00
files=$(git diff --cached --name-only --diff-filter=ACM)
2018-03-06 22:03:44 +01:00
if [ "" != "$files" ]; then
echo "$files" | xargs git add
fi