From f72be1dc8ba1a1bcae297009ece9895a7166a05e Mon Sep 17 00:00:00 2001 From: Florian Imdahl Date: Mon, 13 Jul 2026 11:07:00 +0200 Subject: [PATCH] fix: Local dir discovery --- packages/content-loader/src/docset-init.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/content-loader/src/docset-init.ts b/packages/content-loader/src/docset-init.ts index acab529..7ca0bd7 100644 --- a/packages/content-loader/src/docset-init.ts +++ b/packages/content-loader/src/docset-init.ts @@ -165,12 +165,13 @@ export async function initDocset( let fileCount = 0; const files: string[] = []; async function countFiles(dir: string): Promise { - const entries = await fs.readdir(dir, { withFileTypes: true }); - for (const entry of entries) { - const fullPath = path.join(dir, entry.name); - if (entry.isDirectory()) { + const entries = await fs.readdir(dir); + for (const name of entries) { + const fullPath = path.join(dir, name); + const stat = await fs.stat(fullPath); + if (stat.isDirectory()) { await countFiles(fullPath); - } else if (entry.isFile()) { + } else if (stat.isFile()) { fileCount++; files.push(path.relative(localPath, fullPath)); }