mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 09:24:19 -06:00
Add pre-commit dprint hook, fix post-checkout hook (#55799)
This commit is contained in:
parent
190d70962a
commit
bd902ea410
@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
npm run npx hereby -- generate-diagnostics
|
||||
./node_modules/.bin/hereby generate-diagnostics || true
|
||||
|
||||
4
scripts/hooks/pre-commit
Executable file
4
scripts/hooks/pre-commit
Executable 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
|
||||
@ -11,6 +11,7 @@ const __dirname = path.dirname(__filename);
|
||||
|
||||
const hooks = [
|
||||
"post-checkout",
|
||||
"pre-commit",
|
||||
];
|
||||
|
||||
hooks.forEach(hook => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user