(args: string[], opts: SpawnGbrainOptions = {})
| 159 | * `stderr` exactly as they would with `spawnSync` directly. |
| 160 | */ |
| 161 | export function spawnGbrain(args: string[], opts: SpawnGbrainOptions = {}): SpawnSyncReturns<string> { |
| 162 | return spawnSync("gbrain", args, { |
| 163 | encoding: "utf-8", |
| 164 | timeout: opts.timeout ?? 30_000, |
| 165 | cwd: opts.cwd, |
| 166 | stdio: opts.stdio || ["ignore", "pipe", "pipe"], |
| 167 | env: buildGbrainEnv({ baseEnv: opts.baseEnv, announce: opts.announce }), |
| 168 | shell: NEEDS_SHELL_ON_WINDOWS, // #1731: gbrain is a .cmd shim on Windows |
| 169 | }); |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Run `gbrain <args>` and parse stdout as JSON. Returns `null` on |
no test coverage detected