mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 06:30:03 +00:00
refactor(cli): centralize process lifecycle
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { failCommand } from "../utils/commandResult.js";
|
||||
import { defineCommand } from "citty";
|
||||
import type { Example } from "./_examples.js";
|
||||
|
||||
@@ -297,7 +298,7 @@ export default defineCommand({
|
||||
const msg = singleErr instanceof Error ? singleErr.message : String(singleErr);
|
||||
if (json) console.log(JSON.stringify({ ok: false, error: msg }));
|
||||
else console.error(c.error(msg));
|
||||
process.exit(1);
|
||||
failCommand();
|
||||
}
|
||||
|
||||
let config = loadProjectConfig(projectDir);
|
||||
@@ -320,7 +321,7 @@ export default defineCommand({
|
||||
const msg = singleErr instanceof Error ? singleErr.message : String(singleErr);
|
||||
if (json) console.log(JSON.stringify({ ok: false, error: msg }));
|
||||
else console.error(c.error(msg));
|
||||
process.exit(1);
|
||||
failCommand();
|
||||
}
|
||||
|
||||
if (!json) {
|
||||
|
||||
Reference in New Issue
Block a user