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

Function write

__tests__/git-index-currency.test.ts:43–43  ·  view source on GitHub ↗
(name: string, symbol: string)

Source from the content-addressed store, hash-verified

41 let cg: CodeGraph;
42 const git = (...args: string[]) => cp.execFileSync('git', args, { cwd: root, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] });
43 const write = (name: string, symbol: string) => fs.writeFileSync(path.join(root, name), `export function ${symbol}() { return 1; }\n`);
44 const commit = () => { git('add', '-A'); git('commit', '-m', 'change'); return git('rev-parse', 'HEAD').trim(); };
45 const metadata = () => (cg as any).queries;
46 const symbols = (name: string) => cg.searchNodes(name).map(r => r.node.name);

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected