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

Function spawnGbrainAsync

lib/gbrain-exec.ts:193–203  ·  view source on GitHub ↗
(
  args: string[],
  opts: { stdio?: SpawnOptions["stdio"]; cwd?: string; baseEnv?: NodeJS.ProcessEnv } = {},
)

Source from the content-addressed store, hash-verified

191 * can wire up its own promise around exit/timeout/signal handling.
192 */
193export function spawnGbrainAsync(
194 args: string[],
195 opts: { stdio?: SpawnOptions["stdio"]; cwd?: string; baseEnv?: NodeJS.ProcessEnv } = {},
196): ChildProcess {
197 return spawn("gbrain", args, {
198 stdio: opts.stdio || ["ignore", "pipe", "pipe"],
199 cwd: opts.cwd,
200 env: buildGbrainEnv({ baseEnv: opts.baseEnv, announce: false }),
201 shell: NEEDS_SHELL_ON_WINDOWS, // #1731: gbrain is a .cmd shim on Windows
202 });
203}
204
205/**
206 * Run `gbrain <args>` via execFileSync. Throws on non-zero exit. Useful

Callers 1

runGbrainImportFunction · 0.90

Calls 2

spawnFunction · 0.85
buildGbrainEnvFunction · 0.85

Tested by

no test coverage detected