()
| 87 | } |
| 88 | |
| 89 | function main() { |
| 90 | try { |
| 91 | const args = parseArgs(process.argv.slice(2)); |
| 92 | if (args.help) { |
| 93 | process.stdout.write(`${usage()}\n`); |
| 94 | return; |
| 95 | } |
| 96 | const result = runDeploySteward(args.projectRoot, { |
| 97 | ...args, |
| 98 | command: process.argv.join(' '), |
| 99 | }); |
| 100 | if (args.json) process.stdout.write(`${JSON.stringify(result, null, 2)}\n`); |
| 101 | else process.stdout.write(renderReport(result)); |
| 102 | const hasRepair = result.events.some((event) => event.action === 'repair-needed'); |
| 103 | const hasBlocked = result.queue.some((item) => ['blocked', 'stale'].includes(item.status)); |
| 104 | process.exitCode = hasRepair || hasBlocked ? 1 : 0; |
| 105 | } catch (error) { |
| 106 | process.stderr.write(`${error.message}\n`); |
| 107 | process.exit(1); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | if (require.main === module) main(); |
| 112 |
no test coverage detected