From 09169784bd2d0ab7acf5f40dc86f36f1cae967b7 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 30 Apr 2025 19:40:01 +0200 Subject: [PATCH] fix: improve CLI file scanning performances --- cli/sync.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/sync.ts b/cli/sync.ts index f31cf3f328..867b8c4d17 100644 --- a/cli/sync.ts +++ b/cli/sync.ts @@ -609,11 +609,16 @@ export async function* readDirRecursiveWithIgnore( while (stack.length > 0) { const e = stack.pop()!; + // console.log(e.path); yield e; for await (const e2 of e.c()) { - if (e2.path.startsWith(".git" + SEP)) { - continue; + if (e2.isDirectory) { + const dirName = e2.path.split(SEP).pop(); + if (dirName == "node_modules" || dirName?.startsWith(".")) { + continue; + } } + // console.log(e2.path); stack.push({ path: e2.path, ignored: e.ignored || ignore(e2.path, e2.isDirectory),