MCPcopy
hub / github.com/garrytan/gstack / runScript

Function runScript

test/gstack-gbrain-sync.test.ts:29–40  ·  view source on GitHub ↗
(args: string[], env: Record<string, string> = {})

Source from the content-addressed store, hash-verified

27}
28
29function runScript(args: string[], env: Record<string, string> = {}): { stdout: string; stderr: string; exitCode: number } {
30 const result = spawnSync("bun", [SCRIPT, ...args], {
31 encoding: "utf-8",
32 timeout: 60000,
33 env: { ...process.env, ...env },
34 });
35 return {
36 stdout: result.stdout || "",
37 stderr: result.stderr || "",
38 exitCode: result.status ?? 1,
39 };
40}
41
42describe("gstack-gbrain-sync CLI", () => {
43 it("--help exits 0 with usage text", () => {

Callers 1

Calls 1

spawnSyncFunction · 0.85

Tested by

no test coverage detected