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

Function runScript

test/gstack-brain-context-load.test.ts:17–28  ·  view source on GitHub ↗
(args: string[], env: Record<string, string> = {})

Source from the content-addressed store, hash-verified

15const SCRIPT = join(import.meta.dir, "..", "bin", "gstack-brain-context-load.ts");
16
17function runScript(args: string[], env: Record<string, string> = {}): { stdout: string; stderr: string; exitCode: number } {
18 const result = spawnSync("bun", [SCRIPT, ...args], {
19 encoding: "utf-8",
20 timeout: 30000,
21 env: { ...process.env, ...env },
22 });
23 return {
24 stdout: result.stdout || "",
25 stderr: result.stderr || "",
26 exitCode: result.status ?? 1,
27 };
28}
29
30function writeFakeGbrain(binDir: string): void {
31 if (process.platform === "win32") {

Calls 1

spawnSyncFunction · 0.85

Tested by

no test coverage detected