@zuplo/cli 1.73.0 → 1.75.0

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/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="19cb753a-00b0-5219-b465-ac77d486084b")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7c03187a-eb71-5993-8d8a-86c1be053d09")}catch(e){}}();
3
3
  import * as dotenv from "dotenv";
4
4
  dotenv.config();
5
5
  import * as Sentry from "@sentry/node";
@@ -23,7 +23,7 @@ import variable from "./cmds/variable/index.js";
23
23
  import { shutdownAnalytics } from "./common/analytics/lib.js";
24
24
  import { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from "./common/constants.js";
25
25
  import { logger } from "./common/logger.js";
26
- import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, } from "./common/output.js";
26
+ import { printCriticalFailureToConsoleAndExit } from "./common/output.js";
27
27
  const MIN_NODE_VERSION = "18.0.0";
28
28
  if (gte(process.versions.node, MIN_NODE_VERSION)) {
29
29
  let packageJson;
@@ -38,37 +38,39 @@ if (gte(process.versions.node, MIN_NODE_VERSION)) {
38
38
  dsn: SENTRY_DSN,
39
39
  release: packageJson?.version,
40
40
  });
41
- await yargs(hideBin(process.argv))
42
- .env("ZUPLO")
43
- .command(convert)
44
- .command(deleteZup)
45
- .command(deploy)
46
- .command(dev)
47
- .command(editor)
48
- .command(list)
49
- .command(link)
50
- .command(login)
51
- .command(test)
52
- .command(project)
53
- .command(tunnel)
54
- .command(variable)
55
- .demandCommand()
56
- .strictCommands()
57
- .version(packageJson?.version)
58
- .fail(async (msg, err, yargs) => {
59
- if (err) {
41
+ try {
42
+ await yargs(hideBin(process.argv))
43
+ .env("ZUPLO")
44
+ .command(convert)
45
+ .command(deleteZup)
46
+ .command(deploy)
47
+ .command(dev)
48
+ .command(editor)
49
+ .command(list)
50
+ .command(link)
51
+ .command(login)
52
+ .command(test)
53
+ .command(project)
54
+ .command(tunnel)
55
+ .command(variable)
56
+ .demandCommand()
57
+ .strictCommands()
58
+ .version(packageJson?.version)
59
+ .fail(false)
60
+ .help().argv;
61
+ void Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
62
+ process.exit(0);
63
+ });
64
+ }
65
+ catch (err) {
66
+ if (err instanceof Error) {
60
67
  Sentry.captureException(err);
61
68
  }
62
- if (msg) {
63
- printDiagnosticsToConsole(msg);
64
- }
65
- printCriticalFailureToConsoleAndExit(await yargs.help());
66
- })
67
- .help().argv;
68
- await shutdownAnalytics();
69
- void Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
70
- process.exit(0);
71
- });
69
+ printCriticalFailureToConsoleAndExit(err.message ?? err);
70
+ }
71
+ finally {
72
+ await shutdownAnalytics();
73
+ }
72
74
  }
73
75
  else {
74
76
  printCriticalFailureToConsoleAndExit(`The zup CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.
@@ -76,4 +78,4 @@ else {
76
78
  Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`);
77
79
  }
78
80
  //# sourceMappingURL=cli.js.map
79
- //# debugId=19cb753a-00b0-5219-b465-ac77d486084b
81
+ //# debugId=7c03187a-eb71-5993-8d8a-86c1be053d09