(arg: string, stdin?: string)
| 25 | const LIB = path.join(ROOT, 'bin', 'gstack-gbrain-lib.sh'); |
| 26 | |
| 27 | function runVerify(arg: string, stdin?: string) { |
| 28 | const res = spawnSync(VERIFY, arg === '' ? [] : [arg], { |
| 29 | input: stdin, |
| 30 | encoding: 'utf-8', |
| 31 | }); |
| 32 | return { |
| 33 | stdout: (res.stdout || '').trim(), |
| 34 | stderr: (res.stderr || '').trim(), |
| 35 | status: res.status ?? -1, |
| 36 | }; |
| 37 | } |
| 38 | |
| 39 | // Invoke a bash snippet that sources the lib and runs something against it. |
| 40 | // Returns stdout + stderr + exit code. Stdin is piped so [ -t 0 ] = false. |
no test coverage detected