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

Function write

__tests__/sparse-checkout.test.ts:109–112  ·  view source on GitHub ↗
(rel: string, body = `class ${path.basename(rel, path.extname(rel))} {}\n`)

Source from the content-addressed store, hash-verified

107 const git = (...args: string[]) =>
108 cp.execFileSync('git', args, { cwd: root, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] });
109 const write = (rel: string, body = `class ${path.basename(rel, path.extname(rel))} {}\n`) => {
110 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
111 fs.writeFileSync(path.join(root, rel), body);
112 };
113 const metadata = (key: string): string | null => (cg as any).queries.getMetadata(key);
114 const indexedPaths = (): string[] => (cg as any).queries.getAllFilePaths().sort();
115 const noChanges = { added: [], modified: [], removed: [] };

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected