(argv: string[], opts: { env?: Record<string, string>; input?: string } = {})
| 31 | let bareRemote: string; |
| 32 | |
| 33 | function run(argv: string[], opts: { env?: Record<string, string>; input?: string } = {}) { |
| 34 | const bin = argv[0]; |
| 35 | const full = bin.startsWith('/') ? bin : path.join(BIN, bin); |
| 36 | const res = spawnSync(full, argv.slice(1), { |
| 37 | env: { ...process.env, GSTACK_HOME: tmpHome, ...(opts.env || {}) }, |
| 38 | encoding: 'utf-8', |
| 39 | input: opts.input, |
| 40 | cwd: ROOT, |
| 41 | }); |
| 42 | return { stdout: res.stdout || '', stderr: res.stderr || '', status: res.status ?? -1 }; |
| 43 | } |
| 44 | |
| 45 | function git(args: string[], cwd?: string) { |
| 46 | const res = spawnSync('git', args, { cwd: cwd || tmpHome, encoding: 'utf-8' }); |
no test coverage detected