@cannbot-ai/install-helper 0.0.2-beta.54 → 0.0.2-beta.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -4541,17 +4541,28 @@ function createCLI() {
|
|
|
4541
4541
|
}
|
|
4542
4542
|
|
|
4543
4543
|
// src/index.ts
|
|
4544
|
+
function isExitError(error) {
|
|
4545
|
+
if (!error) return false;
|
|
4546
|
+
return error.name === "ExitPromptError" || error.message?.includes("force closed") || error.message?.includes("SIGINT") || error.constructor?.name === "ExitPromptError";
|
|
4547
|
+
}
|
|
4548
|
+
function handleExit(error) {
|
|
4549
|
+
if (isExitError(error)) {
|
|
4550
|
+
console.log("\n" + t("init_cancelled"));
|
|
4551
|
+
process.exit(0);
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4544
4554
|
process.on("SIGINT", () => {
|
|
4545
4555
|
console.log("\n" + t("init_cancelled"));
|
|
4546
4556
|
process.exit(0);
|
|
4547
4557
|
});
|
|
4548
4558
|
process.on("uncaughtException", (error) => {
|
|
4549
|
-
|
|
4550
|
-
console.log("\n" + t("init_cancelled"));
|
|
4551
|
-
process.exit(0);
|
|
4552
|
-
}
|
|
4559
|
+
handleExit(error);
|
|
4553
4560
|
throw error;
|
|
4554
4561
|
});
|
|
4562
|
+
process.on("unhandledRejection", (error) => {
|
|
4563
|
+
handleExit(error);
|
|
4564
|
+
process.exit(1);
|
|
4565
|
+
});
|
|
4555
4566
|
var program = createCLI();
|
|
4556
4567
|
program.parse();
|
|
4557
4568
|
//# sourceMappingURL=index.js.map
|