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";
// fallow-ignore-file complexity
import { defineCommand } from "citty";
import { existsSync, mkdtempSync, readFileSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
@@ -666,7 +667,7 @@ export default defineCommand({
console.log(
`\n${c.error("✗")} Could not determine composition duration — no frames captured`,
);
process.exit(1);
failCommand();
}
console.log(
@@ -789,7 +790,7 @@ export default defineCommand({
} catch (err) {
const msg = normalizeErrorMessage(err);
console.error(`\n${c.error("✗")} Snapshot failed: ${msg}`);
process.exit(1);
failCommand();
}
},
});