MCPcopy Create free account
hub / github.com/garrytan/gstack / runLog

Function runLog

test/timeline.test.ts:13–29  ·  view source on GitHub ↗
(input: string, opts: { expectFail?: boolean } = {})

Source from the content-addressed store, hash-verified

11let slugDir: string;
12
13function runLog(input: string, opts: { expectFail?: boolean } = {}): { stdout: string; exitCode: number } {
14 const execOpts: ExecSyncOptionsWithStringEncoding = {
15 cwd: ROOT,
16 env: { ...process.env, GSTACK_HOME: tmpDir },
17 encoding: 'utf-8',
18 timeout: 15000,
19 };
20 try {
21 const stdout = execSync(`${BIN}/gstack-timeline-log '${input.replace(/'/g, "'\\''")}'`, execOpts).trim();
22 return { stdout, exitCode: 0 };
23 } catch (e: any) {
24 if (opts.expectFail) {
25 return { stdout: e.stderr?.toString() || '', exitCode: e.status || 1 };
26 }
27 throw e;
28 }
29}
30
31function runRead(args: string = ''): string {
32 const execOpts: ExecSyncOptionsWithStringEncoding = {

Callers 1

timeline.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected