Skip to content

Commit 44460e0

Browse files
authored
fix(script): pre-commit on deleted files (#419)
1 parent fa65dfb commit 44460e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/ci/husky/pre-commit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ function createMemoizedMicromatchMatcher(patterns = []) {
4747
}
4848

4949
async function preCommit() {
50-
const stagedFiles = (await run(`git diff --name-only --cached`)).split('\n');
50+
const stagedFiles = (await run('git diff --name-only --cached')).split('\n');
5151
const deletedFiles = new Set(
52-
(await run(`git ls-files --deleted`)).split('\n')
52+
(await run('git diff --name-only --staged --diff-filter=D')).split('\n')
5353
);
5454
const matcher = createMemoizedMicromatchMatcher(GENERATED_FILE_PATTERNS);
5555

0 commit comments

Comments
 (0)