()
| 77 | } |
| 78 | |
| 79 | async function main() { |
| 80 | const args = parseArgs(process.argv); |
| 81 | if (args.help) { |
| 82 | process.stdout.write(`${usage()}\n`); |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | if (args.list) { |
| 87 | const reports = listReadinessReports(args.projectRoot); |
| 88 | process.stdout.write(args.json ? `${JSON.stringify(reports, null, 2)}\n` : renderList(reports)); |
| 89 | return; |
| 90 | } |
| 91 | |
| 92 | const report = await checkWorktreeReadiness(args); |
| 93 | process.stdout.write(args.json ? `${JSON.stringify(report, null, 2)}\n` : renderReport(report)); |
| 94 | process.exitCode = report.status === 'blocked' ? 1 : 0; |
| 95 | } |
| 96 | |
| 97 | if (require.main === module) { |
| 98 | main().catch((error) => { |
no test coverage detected