({ name, command, args, cwd, dryRun, timeout = 60000, required = true })
| 40 | } |
| 41 | |
| 42 | function runStep({ name, command, args, cwd, dryRun, timeout = 60000, required = true }) { |
| 43 | const rendered = display(command, args); |
| 44 | if (dryRun) { |
| 45 | return { |
| 46 | name, |
| 47 | command: rendered, |
| 48 | cwd, |
| 49 | required, |
| 50 | skipped: true, |
| 51 | pass: true, |
| 52 | status: 0, |
| 53 | stdout: '', |
| 54 | stderr: '', |
| 55 | json: null, |
| 56 | }; |
| 57 | } |
| 58 | |
| 59 | const result = spawnSync(command, args, { |
| 60 | cwd, |
| 61 | encoding: 'utf8', |
| 62 | stdio: ['ignore', 'pipe', 'pipe'], |
| 63 | shell: process.platform === 'win32' && command === 'codex', |
| 64 | timeout, |
| 65 | }); |
| 66 | |
| 67 | return { |
| 68 | name, |
| 69 | command: rendered, |
| 70 | cwd, |
| 71 | required, |
| 72 | skipped: false, |
| 73 | pass: result.status === 0, |
| 74 | status: result.status, |
| 75 | stdout: (result.stdout || '').slice(0, 12000), |
| 76 | stderr: (result.stderr || '').slice(0, 12000), |
| 77 | error: result.error ? result.error.message : null, |
| 78 | json: parseJson(result.stdout), |
| 79 | }; |
| 80 | } |
| 81 | |
| 82 | function printHuman(report) { |
| 83 | console.log('Citadel Codex install'); |
no test coverage detected