1 parent 1057293 commit f72be1dCopy full SHA for f72be1d
1 file changed
packages/content-loader/src/docset-init.ts
@@ -165,12 +165,13 @@ export async function initDocset(
165
let fileCount = 0;
166
const files: string[] = [];
167
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()) {
+ const entries = await fs.readdir(dir);
+ for (const name of entries) {
+ const fullPath = path.join(dir, name);
+ const stat = await fs.stat(fullPath);
172
+ if (stat.isDirectory()) {
173
await countFiles(fullPath);
- } else if (entry.isFile()) {
174
+ } else if (stat.isFile()) {
175
fileCount++;
176
files.push(path.relative(localPath, fullPath));
177
}
0 commit comments