(cmd: string, cwd: string)
| 68 | |
| 69 | const setupLog: string[] = []; |
| 70 | const sh = (cmd: string, cwd: string): void => { |
| 71 | setupLog.push(`[${cwd}] ${cmd}`); |
| 72 | const result = spawnSync('bash', ['-c', cmd], { cwd, stdio: 'pipe', timeout: 15_000 }); |
| 73 | if (result.status !== 0) { |
| 74 | const stderr = result.stderr?.toString() ?? ''; |
| 75 | throw new Error(`fixture setup failed at "${cmd}":\n${stderr}\n--- log ---\n${setupLog.join('\n')}`); |
| 76 | } |
| 77 | }; |
| 78 | |
| 79 | // Bare remote. |
| 80 | sh(`git init --bare "${bareRemote}"`, root); |
no test coverage detected