(
args: string[],
opts: { stdio?: SpawnOptions["stdio"]; cwd?: string; baseEnv?: NodeJS.ProcessEnv } = {},
)
| 191 | * can wire up its own promise around exit/timeout/signal handling. |
| 192 | */ |
| 193 | export 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 |
no test coverage detected