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

Function write

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

Source from the content-addressed store, hash-verified

35 const git = (...args: string[]) =>
36 cp.execFileSync('git', args, { cwd: project, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }) as string;
37 const write = (rel: string, body = `export class ${path.basename(rel, '.ts')} {}\n`) => {
38 fs.mkdirSync(path.dirname(path.join(project, rel)), { recursive: true });
39 fs.writeFileSync(path.join(project, rel), body);
40 };
41 const tempDir = (name: string) => {
42 const dir = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), name)));
43 made.push(dir);

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected