@cannbot-ai/install-helper 0.0.2-beta.53 → 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 CHANGED
@@ -4541,13 +4541,28 @@ function createCLI() {
4541
4541
  }
4542
4542
 
4543
4543
  // src/index.ts
4544
- process.on("uncaughtException", (error) => {
4545
- if (error.name === "ExitPromptError") {
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)) {
4546
4550
  console.log("\n" + t("init_cancelled"));
4547
4551
  process.exit(0);
4548
4552
  }
4553
+ }
4554
+ process.on("SIGINT", () => {
4555
+ console.log("\n" + t("init_cancelled"));
4556
+ process.exit(0);
4557
+ });
4558
+ process.on("uncaughtException", (error) => {
4559
+ handleExit(error);
4549
4560
  throw error;
4550
4561
  });
4562
+ process.on("unhandledRejection", (error) => {
4563
+ handleExit(error);
4564
+ process.exit(1);
4565
+ });
4551
4566
  var program = createCLI();
4552
4567
  program.parse();
4553
4568
  //# sourceMappingURL=index.js.map