MCPcopy
hub / github.com/Fission-AI/OpenSpec / listRelativeEntries

Function listRelativeEntries

test/cli-e2e/store-lifecycle.test.ts:83–103  ·  view source on GitHub ↗
(root: string, skipDirs: Set<string>)

Source from the content-addressed store, hash-verified

81}
82
83async function listRelativeEntries(root: string, skipDirs: Set<string>): Promise<string[]> {
84 const found: string[] = [];
85
86 async function walk(current: string): Promise<void> {
87 const entries = await fs.readdir(current, { withFileTypes: true });
88 for (const entry of entries) {
89 const absolute = path.join(current, entry.name);
90 const relative = path.relative(root, absolute).split(path.sep).join('/');
91 if (entry.isDirectory()) {
92 if (skipDirs.has(entry.name)) continue;
93 found.push(`${relative}/`);
94 await walk(absolute);
95 } else {
96 found.push(relative);
97 }
98 }
99 }
100
101 await walk(root);
102 return found.sort();
103}
104
105async function writeCompletedChangeArtifacts(
106 changeDir: string,

Callers 1

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected