Skip to content

Commit f72be1d

Browse files
committed
fix: Local dir discovery
1 parent 1057293 commit f72be1d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

packages/content-loader/src/docset-init.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,13 @@ export async function initDocset(
165165
let fileCount = 0;
166166
const files: string[] = [];
167167
async function countFiles(dir: string): Promise<void> {
168-
const entries = await fs.readdir(dir, { withFileTypes: true });
169-
for (const entry of entries) {
170-
const fullPath = path.join(dir, entry.name);
171-
if (entry.isDirectory()) {
168+
const entries = await fs.readdir(dir);
169+
for (const name of entries) {
170+
const fullPath = path.join(dir, name);
171+
const stat = await fs.stat(fullPath);
172+
if (stat.isDirectory()) {
172173
await countFiles(fullPath);
173-
} else if (entry.isFile()) {
174+
} else if (stat.isFile()) {
174175
fileCount++;
175176
files.push(path.relative(localPath, fullPath));
176177
}

0 commit comments

Comments
 (0)