MCPcopy
hub / github.com/opentrace/opentrace / readAllFiles

Function readAllFiles

ui/src/components/pipeline/__tests__/cross-repo.test.ts:41–58  ·  view source on GitHub ↗
(
  dir: string,
)

Source from the content-addressed store, hash-verified

39const fixtureDir = join(repoRoot, 'tests', 'fixtures', 'python', 'project');
40
41async function readAllFiles(
42 dir: string,
43): Promise<Array<{ path: string; content: string }>> {
44 const entries = await readdir(dir, { withFileTypes: true });
45 const results: Array<{ path: string; content: string }> = [];
46 for (const entry of entries) {
47 const fullPath = join(dir, entry.name);
48 if (entry.isDirectory()) {
49 results.push(...(await readAllFiles(fullPath)));
50 } else {
51 results.push({
52 path: relative(dir, fullPath),
53 content: await readFile(fullPath, 'utf-8'),
54 });
55 }
56 }
57 return results;
58}
59
60function runAndCollect(
61 files: Array<{ path: string; content: string }>,

Callers 1

cross-repo.test.tsFile · 0.70

Calls 3

readdirFunction · 0.85
readFileFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected