MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / project

Function project

__tests__/gitignore-pattern-parity.test.ts:28–38  ·  view source on GitHub ↗
(mode: 'walk' | 'git', gitignore: string, files: string[])

Source from the content-addressed store, hash-verified

26});
27
28function project(mode: 'walk' | 'git', gitignore: string, files: string[]): string {
29 const root = fs.mkdtempSync(path.join(os.tmpdir(), `cg-gitignore-parity-${mode}-`));
30 roots.push(root);
31 for (const file of files) {
32 fs.mkdirSync(path.dirname(path.join(root, file)), { recursive: true });
33 fs.writeFileSync(path.join(root, file), 'export const value = 1;\n');
34 }
35 fs.writeFileSync(path.join(root, '.gitignore'), gitignore);
36 if (mode === 'git') execFileSync('git', ['init', '-q'], { cwd: root, stdio: 'ignore' });
37 return root;
38}
39
40function scanned(root: string): string[] {
41 return scanDirectory(root).map((f) => f.replace(/\\/g, '/')).sort();

Calls 2

pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected