@hubspot/cli 7.1.1-beta.1 → 7.1.1

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.
@@ -1,6 +1,6 @@
1
1
  import { Argv, ArgumentsCamelCase } from 'yargs';
2
2
  import { CommonArgs, ConfigArgs } from '../../types/Yargs';
3
- export declare const command = "rename <accountName> <newName>";
3
+ export declare const command = "rename <account-name> <new-name>";
4
4
  export declare const describe: string;
5
5
  type AccountRenameArgs = CommonArgs & ConfigArgs & {
6
6
  accountName: string;
@@ -8,29 +8,40 @@ const config_1 = require("@hubspot/local-dev-lib/config");
8
8
  const commonOpts_1 = require("../../lib/commonOpts");
9
9
  const usageTracking_1 = require("../../lib/usageTracking");
10
10
  const lang_1 = require("../../lib/lang");
11
+ const errorHandlers_1 = require("../../lib/errorHandlers");
12
+ const exitCodes_1 = require("../../lib/enums/exitCodes");
11
13
  const i18nKey = 'commands.account.subcommands.rename';
12
- exports.command = 'rename <accountName> <newName>';
14
+ exports.command = 'rename <account-name> <new-name>';
13
15
  exports.describe = (0, lang_1.i18n)(`${i18nKey}.describe`);
14
16
  async function handler(args) {
15
17
  const { accountName, newName, derivedAccountId } = args;
16
18
  (0, usageTracking_1.trackCommandUsage)('accounts-rename', undefined, derivedAccountId);
17
- await (0, config_1.renameAccount)(accountName, newName);
18
- return logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.success.renamed`, {
19
+ try {
20
+ await (0, config_1.renameAccount)(accountName, newName);
21
+ }
22
+ catch (error) {
23
+ (0, errorHandlers_1.logError)(error);
24
+ process.exit(exitCodes_1.EXIT_CODES.ERROR);
25
+ }
26
+ logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.success.renamed`, {
19
27
  name: accountName,
20
28
  newName,
21
29
  }));
30
+ process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
22
31
  }
23
32
  function builder(yargs) {
24
33
  (0, commonOpts_1.addConfigOptions)(yargs);
25
34
  (0, commonOpts_1.addAccountOptions)(yargs);
26
- yargs.positional('accountName', {
35
+ yargs.positional('account-name', {
27
36
  describe: (0, lang_1.i18n)(`${i18nKey}.positionals.accountName.describe`),
28
37
  type: 'string',
29
38
  });
30
- yargs.positional('newName', {
39
+ yargs.positional('new-name', {
31
40
  describe: (0, lang_1.i18n)(`${i18nKey}.positionals.newName.describe`),
32
41
  type: 'string',
33
42
  });
34
- yargs.example([['$0 accounts rename myExistingPortalName myNewPortalName']]);
43
+ yargs.example([
44
+ ['$0 accounts rename myExistingAccountName myNewAccountName'],
45
+ ]);
35
46
  return yargs;
36
47
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.1.1-beta.1",
3
+ "version": "7.1.1",
4
4
  "description": "The official CLI for developing on HubSpot",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/HubSpot/hubspot-cli",
7
7
  "dependencies": {
8
- "@hubspot/local-dev-lib": "3.3.0",
8
+ "@hubspot/local-dev-lib": "3.3.1",
9
9
  "@hubspot/project-parsing-lib": "0.0.4",
10
10
  "@hubspot/serverless-dev-runtime": "7.0.2",
11
11
  "@hubspot/theme-preview-dev-server": "0.0.10",