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

Function runNode

__tests__/cli-node-command.test.ts:22–33  ·  view source on GitHub ↗
(cwd: string, extraArgs: string[])

Source from the content-addressed store, hash-verified

20const BIN = path.resolve(__dirname, '../dist/bin/codegraph.js');
21
22function runNode(cwd: string, extraArgs: string[]): { stdout: string; stderr: string; code: number } {
23 try {
24 const stdout = execFileSync(process.execPath, [BIN, 'node', ...extraArgs, '-p', cwd], {
25 encoding: 'utf-8',
26 env: { ...process.env, CODEGRAPH_NO_DAEMON: '1', CODEGRAPH_WASM_RELAUNCHED: '1' },
27 stdio: ['ignore', 'pipe', 'pipe'],
28 });
29 return { stdout, stderr: '', code: 0 };
30 } catch (err: any) {
31 return { stdout: err.stdout ?? '', stderr: err.stderr ?? '', code: err.status ?? 1 };
32 }
33}
34
35describe('codegraph node — argument handling (#1044)', () => {
36 let tempDir: string;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected