refactor(cli): centralize process lifecycle

This commit is contained in:
James
2026-07-20 09:04:03 -07:00
parent 6ad738b580
commit 3aa2404747
71 changed files with 812 additions and 434 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import { failCommand } from "../../utils/commandResult.js";
/**
* `hyperframes cloud delete <render_id>` — soft-delete a cloud render.
*
@@ -53,14 +54,14 @@ export default defineCommand({
"delete cannot prompt for confirmation here — stdin isn't a TTY or --json was passed.",
"Re-run with --no-confirm to acknowledge the irreversible delete.",
);
process.exit(1);
failCommand();
}
const ok = await confirmDelete(args.id);
if (!ok) {
// Distinct exit code so wrapper scripts can tell an explicit
// decline apart from an API/system error.
console.log(c.dim("Aborted."));
process.exit(2);
failCommand(2);
}
}
const client = await createCloudClient();