We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38c0ddc commit 3bf48b7Copy full SHA for 3bf48b7
scripts/ci/husky/pre-commit.js
@@ -41,15 +41,17 @@ async function preCommit() {
41
const stagedFiles = (await run('git diff --name-only --cached')).split('\n');
42
43
const toUnstage = micromatch.match(stagedFiles, getPatterns());
44
+ if (toUnstage.length === 0) {
45
+ return;
46
+ }
47
- for (const file of toUnstage) {
48
+ toUnstage.forEach((file) =>
49
console.log(
50
chalk.black.bgYellow('[INFO]'),
51
`Generated file found, unstaging: ${file}`
- );
-
- await run(`git restore --staged ${file}`);
52
- }
+ )
53
+ );
54
+ await run(`git restore --staged ${toUnstage.join(' ')}`);
55
}
56
57
if (require.main === module && !process.env.CI) {
0 commit comments