Add pre-commit dprint hook, fix post-checkout hook (#55799)

This commit is contained in:
Jake Bailey
2023-09-20 13:39:19 -07:00
committed by GitHub
parent 190d70962a
commit bd902ea410
3 changed files with 6 additions and 1 deletions

4
scripts/hooks/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
if git diff --name-only --cached --relative | xargs --no-run-if-empty ./node_modules/.bin/dprint fmt; then
git diff --name-only --cached --relative | xargs --no-run-if-empty git add
fi