MCPcopy
hub / github.com/inkeep/open-knowledge / walkStagedFiles

Function walkStagedFiles

packages/cli/src/diagnose/bundle.ts:295–310  ·  view source on GitHub ↗
(stagingDir: string)

Source from the content-addressed store, hash-verified

293}
294
295function walkStagedFiles(stagingDir: string): string[] {
296 const results: string[] = [];
297 const recurse = (dir: string): void => {
298 const entries = readdirSync(dir, { withFileTypes: true });
299 for (const entry of entries) {
300 const full = join(dir, entry.name);
301 if (entry.isDirectory()) {
302 recurse(full);
303 } else if (entry.isFile()) {
304 results.push(full);
305 }
306 }
307 };
308 recurse(stagingDir);
309 return results.sort();
310}
311
312const LINE_COUNTED_EXTENSIONS = new Set(['.jsonl']);
313

Callers 2

collectBundleFunction · 0.85
writeBundleFunction · 0.85

Calls 1

recurseFunction · 0.85

Tested by

no test coverage detected