Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/content-loader/src/docset-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
export interface InitDocsetOptions {
force?: boolean;
/** Called after each source is processed so callers can show progress */
onSourceProgress?: (result: SourceResult) => void;

Check warning on line 38 in packages/content-loader/src/docset-init.ts

View workflow job for this annotation

GitHub Actions / test

'result' is defined but never used. Allowed unused args must match /^_/u
}

/**
Expand Down Expand Up @@ -165,12 +165,13 @@
let fileCount = 0;
const files: string[] = [];
async function countFiles(dir: string): Promise<void> {
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));
}
Expand Down
Loading