Skip to content

Commit 25f97c5

Browse files
committed
fix: improve CLI file scanning performances
1 parent 4c660a8 commit 25f97c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cli/sync.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,16 @@ export async function* readDirRecursiveWithIgnore(
609609

610610
while (stack.length > 0) {
611611
const e = stack.pop()!;
612+
// console.log(e.path);
612613
yield e;
613614
for await (const e2 of e.c()) {
614-
if (e2.path.startsWith(".git" + SEP)) {
615-
continue;
615+
if (e2.isDirectory) {
616+
const dirName = e2.path.split(SEP).pop();
617+
if (dirName == "node_modules" || dirName?.startsWith(".")) {
618+
continue;
619+
}
616620
}
621+
console.log(e2.path);
617622
stack.push({
618623
path: e2.path,
619624
ignored: e.ignored || ignore(e2.path, e2.isDirectory),

0 commit comments

Comments
 (0)