@hubspot/cli 7.2.5-experimental.0 → 7.3.0-beta.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/bin/cli.js +10 -60
- package/commands/account/clean.js +12 -44
- package/commands/account/info.js +9 -33
- package/commands/account/list.js +9 -28
- package/commands/account/remove.js +8 -37
- package/commands/account/rename.js +4 -5
- package/commands/account/use.js +7 -21
- package/commands/account.js +0 -6
- package/commands/auth.js +2 -6
- package/commands/cms/convertFields.js +5 -6
- package/commands/cms/getReactModule.js +7 -8
- package/commands/cms/lighthouseScore.js +15 -16
- package/commands/config/set.d.ts +0 -12
- package/commands/config/set.js +29 -31
- package/commands/config.d.ts +1 -4
- package/commands/config.js +10 -45
- package/commands/create/api-sample.js +6 -7
- package/commands/create/module.js +1 -2
- package/commands/create/template.js +1 -2
- package/commands/customObject/create.js +8 -9
- package/commands/customObject/schema/create.js +5 -6
- package/commands/customObject/schema/delete.js +9 -10
- package/commands/customObject/schema/fetch-all.js +7 -8
- package/commands/customObject/schema/fetch.js +9 -10
- package/commands/customObject/schema/list.js +2 -3
- package/commands/customObject/schema/update.js +7 -8
- package/commands/customObject/schema.js +1 -2
- package/commands/customObject.d.ts +1 -1
- package/commands/filemanager/fetch.js +5 -6
- package/commands/filemanager/upload.js +12 -13
- package/commands/function/deploy.js +9 -10
- package/commands/function/list.js +4 -5
- package/commands/function/server.js +7 -8
- package/commands/init.js +10 -9
- package/commands/mv.d.ts +1 -1
- package/commands/project/add.d.ts +10 -0
- package/commands/project/add.js +64 -52
- package/commands/project/create.js +1 -0
- package/commands/project/deploy.d.ts +11 -1
- package/commands/project/deploy.js +79 -71
- package/commands/project/dev/index.d.ts +1 -1
- package/commands/project/download.d.ts +11 -0
- package/commands/project/download.js +56 -54
- package/commands/project/listBuilds.d.ts +10 -0
- package/commands/project/listBuilds.js +101 -91
- package/commands/project/open.d.ts +9 -0
- package/commands/project/open.js +43 -35
- package/commands/sandbox/create.d.ts +1 -1
- package/commands/sandbox/delete.d.ts +1 -1
- package/commands/sandbox.d.ts +1 -1
- package/lang/en.js +3453 -0
- package/lang/en.lyaml +17 -88
- package/lib/DevServerManagerV2.d.ts +1 -2
- package/lib/DevServerManagerV2.js +1 -2
- package/lib/LocalDevManagerV2.js +10 -15
- package/lib/dependencyManagement.js +8 -9
- package/lib/doctor/Diagnosis.d.ts +2 -1
- package/lib/doctor/Diagnosis.js +6 -10
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +0 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +0 -1
- package/lib/doctor/Doctor.d.ts +0 -1
- package/lib/doctor/Doctor.js +0 -18
- package/lib/errorHandlers/index.js +17 -0
- package/lib/projects/buildAndDeploy.d.ts +1 -1
- package/lib/projects/buildAndDeploy.js +1 -1
- package/lib/projects/index.d.ts +1 -1
- package/lib/projects/index.js +1 -1
- package/lib/projects/structure.d.ts +1 -2
- package/lib/projects/structure.js +0 -4
- package/lib/prompts/downloadProjectPrompt.js +5 -1
- package/lib/prompts/projectNamePrompt.d.ts +6 -1
- package/lib/prompts/projectNamePrompt.js +17 -16
- package/lib/testUtils.d.ts +4 -2
- package/lib/testUtils.js +17 -3
- package/lib/ui/index.d.ts +2 -2
- package/lib/ui/index.js +0 -5
- package/lib/yargsUtils.d.ts +2 -2
- package/lib/yargsUtils.js +2 -2
- package/package.json +4 -4
- package/types/ProjectComponents.d.ts +0 -15
- package/commands/account/auth.d.ts +0 -10
- package/commands/account/auth.js +0 -169
- package/commands/account/createOverride.d.ts +0 -10
- package/commands/account/createOverride.js +0 -103
- package/commands/account/removeOverride.d.ts +0 -10
- package/commands/account/removeOverride.js +0 -77
- package/commands/config/migrate.d.ts +0 -10
- package/commands/config/migrate.js +0 -85
- package/lib/configMigrate.d.ts +0 -2
- package/lib/configMigrate.js +0 -105
package/bin/cli.js
CHANGED
|
@@ -6,7 +6,6 @@ const chalk = require('chalk');
|
|
|
6
6
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
7
7
|
const { addUserAgentHeader } = require('@hubspot/local-dev-lib/http');
|
|
8
8
|
const { loadConfig, getAccountId, configFileExists, getConfigPath, validateConfig, } = require('@hubspot/local-dev-lib/config');
|
|
9
|
-
const { DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID, DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND, DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME, } = require('@hubspot/local-dev-lib/constants/config');
|
|
10
9
|
const { logError } = require('../lib/errorHandlers/index');
|
|
11
10
|
const { setLogLevel, getCommandName } = require('../lib/commonOpts');
|
|
12
11
|
const { validateAccount } = require('../lib/validation');
|
|
@@ -49,15 +48,14 @@ const notifier = updateNotifier({
|
|
|
49
48
|
distTag: 'latest',
|
|
50
49
|
shouldNotifyInNpmScript: true,
|
|
51
50
|
});
|
|
52
|
-
const i18nKey = 'commands.generalErrors';
|
|
53
51
|
const CMS_CLI_PACKAGE_NAME = '@hubspot/cms-cli';
|
|
54
52
|
notifier.notify({
|
|
55
53
|
message: pkg.name === CMS_CLI_PACKAGE_NAME
|
|
56
|
-
? i18n(
|
|
54
|
+
? i18n(`commands.generalErrors.updateNotify.cmsUpdateNotification`, {
|
|
57
55
|
packageName: CMS_CLI_PACKAGE_NAME,
|
|
58
56
|
updateCommand: uiCommandReference('{updateCommand}'),
|
|
59
57
|
})
|
|
60
|
-
: i18n(
|
|
58
|
+
: i18n(`commands.generalErrors.updateNotify.cliUpdateNotification`, {
|
|
61
59
|
updateCommand: uiCommandReference('{updateCommand}'),
|
|
62
60
|
}),
|
|
63
61
|
defer: false,
|
|
@@ -69,7 +67,7 @@ notifier.notify({
|
|
|
69
67
|
borderStyle: 'round',
|
|
70
68
|
title: pkg.name === CMS_CLI_PACKAGE_NAME
|
|
71
69
|
? null
|
|
72
|
-
: chalk.bold(i18n(
|
|
70
|
+
: chalk.bold(i18n(`commands.generalErrors.updateNotify.notifyTitle`)),
|
|
73
71
|
},
|
|
74
72
|
});
|
|
75
73
|
const getTerminalWidth = () => {
|
|
@@ -98,13 +96,13 @@ const performChecks = argv => {
|
|
|
98
96
|
if (argv._[0] === 'config' &&
|
|
99
97
|
argv._[1] === 'set' &&
|
|
100
98
|
argv._[2] === 'default-account') {
|
|
101
|
-
logger.error(i18n(
|
|
99
|
+
logger.error(i18n(`commands.generalErrors.setDefaultAccountMoved`));
|
|
102
100
|
process.exit(EXIT_CODES.ERROR);
|
|
103
101
|
}
|
|
104
102
|
// Require "project" command when running upload/watch inside of a project
|
|
105
103
|
if (argv._.length === 1 && ['upload', 'watch'].includes(argv._[0])) {
|
|
106
104
|
if (getIsInProject(argv.src)) {
|
|
107
|
-
logger.error(i18n(
|
|
105
|
+
logger.error(i18n(`commands.generalErrors.srcIsProject`, {
|
|
108
106
|
src: argv.src || './',
|
|
109
107
|
command: argv._.join(' '),
|
|
110
108
|
}));
|
|
@@ -138,17 +136,9 @@ const isTargetedCommand = (options, commandMap) => {
|
|
|
138
136
|
};
|
|
139
137
|
return checkCommand(options, commandMap);
|
|
140
138
|
};
|
|
141
|
-
const skipConfigAccountsSubCommands = {
|
|
142
|
-
target: false,
|
|
143
|
-
subCommands: {
|
|
144
|
-
auth: { target: true },
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
139
|
const SKIP_CONFIG_VALIDATION = {
|
|
148
140
|
init: { target: true },
|
|
149
141
|
auth: { target: true },
|
|
150
|
-
accounts: skipConfigAccountsSubCommands,
|
|
151
|
-
account: skipConfigAccountsSubCommands,
|
|
152
142
|
};
|
|
153
143
|
const handleDeprecatedEnvVariables = options => {
|
|
154
144
|
// HUBSPOT_PORTAL_ID is deprecated, but we'll still support it for now
|
|
@@ -156,7 +146,7 @@ const handleDeprecatedEnvVariables = options => {
|
|
|
156
146
|
if (options.useEnv &&
|
|
157
147
|
process.env.HUBSPOT_PORTAL_ID &&
|
|
158
148
|
!process.env.HUBSPOT_ACCOUNT_ID) {
|
|
159
|
-
uiDeprecatedTag(i18n(
|
|
149
|
+
uiDeprecatedTag(i18n(`commands.generalErrors.handleDeprecatedEnvVariables.portalEnvVarDeprecated`, {
|
|
160
150
|
configPath: getConfigPath(),
|
|
161
151
|
}));
|
|
162
152
|
process.env.HUBSPOT_ACCOUNT_ID = process.env.HUBSPOT_PORTAL_ID;
|
|
@@ -173,39 +163,9 @@ const injectAccountIdMiddleware = async (options) => {
|
|
|
173
163
|
options.derivedAccountId = parseInt(process.env.HUBSPOT_ACCOUNT_ID, 10);
|
|
174
164
|
}
|
|
175
165
|
else {
|
|
176
|
-
|
|
177
|
-
options.derivedAccountId = getAccountId(account);
|
|
178
|
-
}
|
|
179
|
-
catch (error) {
|
|
180
|
-
logError(error);
|
|
181
|
-
if (error.cause === DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID) {
|
|
182
|
-
logger.log(i18n(`${i18nKey}.injectAccountIdMiddleware.invalidAccountId`, {
|
|
183
|
-
overrideCommand: uiCommandReference('hs account create-override'),
|
|
184
|
-
hsAccountFileName: DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME,
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
if (error.cause === DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND) {
|
|
188
|
-
logger.log(i18n(`${i18nKey}.injectAccountIdMiddleware.accountNotFound`, {
|
|
189
|
-
configPath: getConfigPath(),
|
|
190
|
-
authCommand: uiCommandReference('hs account auth'),
|
|
191
|
-
hsAccountFileName: DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME,
|
|
192
|
-
}));
|
|
193
|
-
}
|
|
194
|
-
process.exit(EXIT_CODES.ERROR);
|
|
195
|
-
}
|
|
166
|
+
options.derivedAccountId = getAccountId(account);
|
|
196
167
|
}
|
|
197
168
|
};
|
|
198
|
-
const skipLoadConfigAccountSubCommands = {
|
|
199
|
-
target: false,
|
|
200
|
-
subCommands: { auth: { target: true } },
|
|
201
|
-
};
|
|
202
|
-
const SKIP_LOAD_CONFIG = {
|
|
203
|
-
account: skipLoadConfigAccountSubCommands,
|
|
204
|
-
accounts: skipLoadConfigAccountSubCommands,
|
|
205
|
-
};
|
|
206
|
-
const SKIP_CONFIG_FLAG_VALIDATION = {
|
|
207
|
-
config: { target: false, subCommands: { migrate: { target: true } } },
|
|
208
|
-
};
|
|
209
169
|
const loadConfigMiddleware = async (options) => {
|
|
210
170
|
// Skip this when no command is provided
|
|
211
171
|
if (!options._.length) {
|
|
@@ -217,21 +177,13 @@ const loadConfigMiddleware = async (options) => {
|
|
|
217
177
|
process.exit(EXIT_CODES.ERROR);
|
|
218
178
|
}
|
|
219
179
|
};
|
|
220
|
-
if (configFileExists(true) &&
|
|
221
|
-
|
|
222
|
-
!isTargetedCommand(options, SKIP_CONFIG_FLAG_VALIDATION)) {
|
|
223
|
-
logger.error(i18n(`${i18nKey}.loadConfigMiddleware.configFileExists`, {
|
|
180
|
+
if (configFileExists(true) && options.config) {
|
|
181
|
+
logger.error(i18n(`commands.generalErrors.loadConfigMiddleware.configFileExists`, {
|
|
224
182
|
configPath: getConfigPath(),
|
|
225
183
|
}));
|
|
226
184
|
process.exit(EXIT_CODES.ERROR);
|
|
227
185
|
}
|
|
228
|
-
|
|
229
|
-
// 1. `hs init`
|
|
230
|
-
// 2. `hs account auth` only if the global config file does not exist
|
|
231
|
-
if (!isTargetedCommand(options, {
|
|
232
|
-
init: { target: true },
|
|
233
|
-
}) &&
|
|
234
|
-
!(isTargetedCommand(options, SKIP_LOAD_CONFIG) && !configFileExists(true))) {
|
|
186
|
+
else if (!isTargetedCommand(options, { init: { target: true } })) {
|
|
235
187
|
const { config: configPath } = options;
|
|
236
188
|
const config = loadConfig(configPath, options);
|
|
237
189
|
// We don't run validateConfig() for auth because users should be able to run it when
|
|
@@ -252,7 +204,6 @@ const checkAndWarnGitInclusionMiddleware = options => {
|
|
|
252
204
|
const accountsSubCommands = {
|
|
253
205
|
target: false,
|
|
254
206
|
subCommands: {
|
|
255
|
-
auth: { target: true },
|
|
256
207
|
clean: { target: true },
|
|
257
208
|
list: { target: true },
|
|
258
209
|
ls: { target: true },
|
|
@@ -268,7 +219,6 @@ const sandboxesSubCommands = {
|
|
|
268
219
|
const SKIP_ACCOUNT_VALIDATION = {
|
|
269
220
|
init: { target: true },
|
|
270
221
|
auth: { target: true },
|
|
271
|
-
config: { target: false, subCommands: { migrate: { target: true } } },
|
|
272
222
|
account: accountsSubCommands,
|
|
273
223
|
accounts: accountsSubCommands,
|
|
274
224
|
sandbox: sandboxesSubCommands,
|
|
@@ -6,33 +6,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.describe = exports.command = void 0;
|
|
7
7
|
exports.handler = handler;
|
|
8
8
|
exports.builder = builder;
|
|
9
|
-
const fs_1 = __importDefault(require("fs"));
|
|
10
9
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
11
10
|
const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
12
11
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
13
12
|
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
14
13
|
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
15
|
-
const config_2 = require("@hubspot/local-dev-lib/config");
|
|
16
14
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
17
15
|
const lang_1 = require("../../lib/lang");
|
|
18
16
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
19
17
|
const commonOpts_1 = require("../../lib/commonOpts");
|
|
20
18
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
21
|
-
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
22
19
|
const table_1 = require("../../lib/ui/table");
|
|
23
20
|
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
24
21
|
const ui_1 = require("../../lib/ui");
|
|
25
|
-
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
26
|
-
const i18nKey = 'commands.account.subcommands.clean';
|
|
27
22
|
exports.command = 'clean';
|
|
28
|
-
exports.describe = (0, lang_1.i18n)(
|
|
23
|
+
exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.clean.describe`);
|
|
29
24
|
async function handler(args) {
|
|
30
25
|
const { qa } = args;
|
|
31
26
|
(0, usageTracking_1.trackCommandUsage)('accounts-clean');
|
|
32
27
|
const accountsList = (0, config_1.getConfigAccounts)() || [];
|
|
33
28
|
const filteredTestAccounts = accountsList.filter(p => qa ? p.env === 'qa' : p.env !== 'qa');
|
|
34
29
|
if (filteredTestAccounts && filteredTestAccounts.length === 0) {
|
|
35
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
30
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.clean.noResults`));
|
|
36
31
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
37
32
|
}
|
|
38
33
|
const accountsToRemove = [];
|
|
@@ -40,7 +35,7 @@ async function handler(args) {
|
|
|
40
35
|
succeedColor: 'white',
|
|
41
36
|
});
|
|
42
37
|
SpinniesManager_1.default.add('accountsClean', {
|
|
43
|
-
text: (0, lang_1.i18n)(
|
|
38
|
+
text: (0, lang_1.i18n)(`commands.account.subcommands.clean.loading.add`),
|
|
44
39
|
});
|
|
45
40
|
for (const account of filteredTestAccounts) {
|
|
46
41
|
try {
|
|
@@ -66,65 +61,38 @@ async function handler(args) {
|
|
|
66
61
|
const oneAccountFound = accountsToRemove.length === 1;
|
|
67
62
|
SpinniesManager_1.default.succeed('accountsClean', {
|
|
68
63
|
text: (0, lang_1.i18n)(oneAccountFound
|
|
69
|
-
?
|
|
70
|
-
:
|
|
64
|
+
? `commands.account.subcommands.clean.inactiveAccountsFound.one`
|
|
65
|
+
: `commands.account.subcommands.clean.inactiveAccountsFound.other`, {
|
|
71
66
|
count: accountsToRemove.length,
|
|
72
67
|
}),
|
|
73
68
|
});
|
|
74
69
|
logger_1.logger.log((0, table_1.getTableContents)(accountsToRemove.map(p => [
|
|
75
70
|
(0, ui_1.uiAccountDescription)((0, getAccountIdentifier_1.getAccountIdentifier)(p)),
|
|
76
71
|
]), { border: { bodyLeft: ' ' } }));
|
|
77
|
-
let promptMessage = (0, lang_1.i18n)(oneAccountFound ? `${i18nKey}.confirm.one` : `${i18nKey}.confirm.other`, {
|
|
78
|
-
count: accountsToRemove.length,
|
|
79
|
-
});
|
|
80
|
-
const accountOverride = (0, config_2.getCWDAccountOverride)();
|
|
81
|
-
const overrideFilePath = (0, config_2.getDefaultAccountOverrideFilePath)();
|
|
82
|
-
const accountOverrideMatches = accountsToRemove.some(account => account.name === accountOverride ||
|
|
83
|
-
// @ts-expect-error: Default account override files can only exist with global config
|
|
84
|
-
account.accountId === accountOverride);
|
|
85
|
-
if (overrideFilePath && accountOverride && accountOverrideMatches) {
|
|
86
|
-
promptMessage = `${promptMessage}${(0, lang_1.i18n)(`${i18nKey}.defaultAccountOverride`, {
|
|
87
|
-
overrideFilePath,
|
|
88
|
-
})}`;
|
|
89
|
-
}
|
|
90
72
|
const { accountsCleanPrompt } = await (0, promptUtils_1.promptUser)([
|
|
91
73
|
{
|
|
92
74
|
name: 'accountsCleanPrompt',
|
|
93
75
|
type: 'confirm',
|
|
94
|
-
message:
|
|
76
|
+
message: (0, lang_1.i18n)(oneAccountFound
|
|
77
|
+
? `commands.account.subcommands.clean.confirm.one`
|
|
78
|
+
: `commands.account.subcommands.clean.confirm.other`, {
|
|
79
|
+
count: accountsToRemove.length,
|
|
80
|
+
}),
|
|
95
81
|
},
|
|
96
82
|
]);
|
|
97
83
|
if (accountsCleanPrompt) {
|
|
98
84
|
logger_1.logger.log('');
|
|
99
|
-
try {
|
|
100
|
-
if (overrideFilePath) {
|
|
101
|
-
fs_1.default.unlinkSync(overrideFilePath);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
(0, errorHandlers_1.logError)(error);
|
|
106
|
-
}
|
|
107
85
|
for (const accountToRemove of accountsToRemove) {
|
|
108
86
|
await (0, config_1.deleteAccount)(accountToRemove.name);
|
|
109
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
87
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.clean.removeSuccess`, {
|
|
110
88
|
accountName: accountToRemove.name,
|
|
111
89
|
}));
|
|
112
90
|
}
|
|
113
|
-
// Get updated version of the config
|
|
114
|
-
(0, config_1.loadConfig)((0, config_1.getConfigPath)());
|
|
115
|
-
const defaultAccount = (0, config_1.getConfigDefaultAccount)();
|
|
116
|
-
if (defaultAccount &&
|
|
117
|
-
accountsToRemove.some(p => p.name === defaultAccount)) {
|
|
118
|
-
logger_1.logger.log();
|
|
119
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.replaceDefaultAccount`));
|
|
120
|
-
const newDefaultAccount = await (0, accountsPrompt_1.selectAccountFromConfig)();
|
|
121
|
-
(0, config_1.updateDefaultAccount)(newDefaultAccount);
|
|
122
|
-
}
|
|
123
91
|
}
|
|
124
92
|
}
|
|
125
93
|
else {
|
|
126
94
|
SpinniesManager_1.default.succeed('accountsClean', {
|
|
127
|
-
text: (0, lang_1.i18n)(
|
|
95
|
+
text: (0, lang_1.i18n)(`commands.account.subcommands.clean.noResults`),
|
|
128
96
|
});
|
|
129
97
|
}
|
|
130
98
|
logger_1.logger.log('');
|
package/commands/account/info.js
CHANGED
|
@@ -7,10 +7,8 @@ const config_1 = require("@hubspot/local-dev-lib/config");
|
|
|
7
7
|
const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
8
8
|
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
9
9
|
const lang_1 = require("../../lib/lang");
|
|
10
|
-
const index_1 = require("../../lib/ui/index");
|
|
11
10
|
const table_1 = require("../../lib/ui/table");
|
|
12
|
-
|
|
13
|
-
exports.describe = (0, lang_1.i18n)(`${i18nKey}.describe`);
|
|
11
|
+
exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.info.describe`);
|
|
14
12
|
exports.command = 'info [account]';
|
|
15
13
|
async function handler(args) {
|
|
16
14
|
const { derivedAccountId } = args;
|
|
@@ -21,46 +19,24 @@ async function handler(args) {
|
|
|
21
19
|
let scopeGroups = [];
|
|
22
20
|
const response = await (0, personalAccessKey_1.getAccessToken)(personalAccessKey, env, derivedAccountId);
|
|
23
21
|
scopeGroups = response.scopeGroups.map(s => [s]);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.defaultAccountTitle`));
|
|
28
|
-
logger_1.logger.log(`${(0, index_1.indent)(1)}${(0, lang_1.i18n)(`${i18nKey}.configPath`, {
|
|
29
|
-
configPath,
|
|
30
|
-
})}`);
|
|
31
|
-
logger_1.logger.log(`${(0, index_1.indent)(1)}${(0, lang_1.i18n)(`${i18nKey}.defaultAccount`, {
|
|
32
|
-
account: (0, config_1.getDisplayDefaultAccount)(),
|
|
33
|
-
})}`);
|
|
34
|
-
}
|
|
35
|
-
// If a default account override is present, display it
|
|
36
|
-
const overrideFilePath = (0, config_1.getDefaultAccountOverrideFilePath)();
|
|
37
|
-
if (overrideFilePath) {
|
|
38
|
-
logger_1.logger.log('');
|
|
39
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.overrideFilePathTitle`));
|
|
40
|
-
logger_1.logger.log(`${(0, index_1.indent)(1)}${(0, lang_1.i18n)(`${i18nKey}.overrideFilePath`, { overrideFilePath })}`);
|
|
41
|
-
logger_1.logger.log(`${(0, index_1.indent)(1)}${(0, lang_1.i18n)(`${i18nKey}.overrideAccount`, {
|
|
42
|
-
account: (0, config_1.getConfigDefaultAccount)(),
|
|
43
|
-
})}`);
|
|
44
|
-
}
|
|
45
|
-
logger_1.logger.log('');
|
|
46
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.name`, { name: name }));
|
|
47
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.accountId`, { accountId: derivedAccountId }));
|
|
48
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.scopeGroups`));
|
|
22
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.info.name`, { name: name }));
|
|
23
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.info.accountId`, { accountId: derivedAccountId }));
|
|
24
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.info.scopeGroups`));
|
|
49
25
|
logger_1.logger.log((0, table_1.getTableContents)(scopeGroups, { border: { bodyLeft: ' ' } }));
|
|
50
26
|
}
|
|
51
27
|
else {
|
|
52
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
28
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.info.errors.notUsingPersonalAccessKey`));
|
|
53
29
|
}
|
|
54
30
|
}
|
|
55
31
|
function accountInfoBuilder(yargs) {
|
|
56
32
|
yargs.positional('account', {
|
|
57
|
-
describe: (0, lang_1.i18n)(
|
|
33
|
+
describe: (0, lang_1.i18n)(`commands.account.subcommands.info.options.account.describe`),
|
|
58
34
|
type: 'string',
|
|
59
35
|
});
|
|
60
36
|
yargs.example([
|
|
61
|
-
['$0 accounts info', (0, lang_1.i18n)(
|
|
62
|
-
['$0 accounts info MyAccount', (0, lang_1.i18n)(
|
|
63
|
-
['$0 accounts info 1234567', (0, lang_1.i18n)(
|
|
37
|
+
['$0 accounts info', (0, lang_1.i18n)(`commands.account.subcommands.info.examples.default`)],
|
|
38
|
+
['$0 accounts info MyAccount', (0, lang_1.i18n)(`commands.account.subcommands.info.examples.nameBased`)],
|
|
39
|
+
['$0 accounts info 1234567', (0, lang_1.i18n)(`commands.account.subcommands.info.examples.idBased`)],
|
|
64
40
|
]);
|
|
65
41
|
return yargs;
|
|
66
42
|
}
|
package/commands/account/list.js
CHANGED
|
@@ -7,15 +7,13 @@ const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
|
7
7
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
8
8
|
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
9
9
|
const commonOpts_1 = require("../../lib/commonOpts");
|
|
10
|
-
const index_1 = require("../../lib/ui/index");
|
|
11
10
|
const table_1 = require("../../lib/ui/table");
|
|
12
11
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
13
12
|
const accountTypes_1 = require("../../lib/accountTypes");
|
|
14
13
|
const lang_1 = require("../../lib/lang");
|
|
15
14
|
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
16
|
-
const i18nKey = 'commands.account.subcommands.list';
|
|
17
15
|
exports.command = ['list', 'ls'];
|
|
18
|
-
exports.describe = (0, lang_1.i18n)(
|
|
16
|
+
exports.describe = (0, lang_1.i18n)('commands.account.subcommands.list.describe');
|
|
19
17
|
function sortAndMapAccounts(accounts) {
|
|
20
18
|
const mappedAccountData = {};
|
|
21
19
|
// Standard and app developer accounts
|
|
@@ -78,32 +76,15 @@ async function handler(args) {
|
|
|
78
76
|
const mappedAccountData = sortAndMapAccounts(accountsList);
|
|
79
77
|
const accountData = getAccountData(mappedAccountData);
|
|
80
78
|
accountData.unshift((0, table_1.getTableHeader)([
|
|
81
|
-
(0, lang_1.i18n)(
|
|
82
|
-
(0, lang_1.i18n)(
|
|
83
|
-
(0, lang_1.i18n)(
|
|
79
|
+
(0, lang_1.i18n)('commands.account.subcommands.list.labels.name'),
|
|
80
|
+
(0, lang_1.i18n)('commands.account.subcommands.list.labels.accountId'),
|
|
81
|
+
(0, lang_1.i18n)('commands.account.subcommands.list.labels.authType'),
|
|
84
82
|
]));
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})}`);
|
|
91
|
-
logger_1.logger.log(`${(0, index_1.indent)(1)}${(0, lang_1.i18n)(`${i18nKey}.defaultAccount`, {
|
|
92
|
-
account: (0, config_1.getDisplayDefaultAccount)(),
|
|
93
|
-
})}`);
|
|
94
|
-
logger_1.logger.log('');
|
|
95
|
-
}
|
|
96
|
-
// If a default account override is present, display it
|
|
97
|
-
const overrideFilePath = (0, config_1.getDefaultAccountOverrideFilePath)();
|
|
98
|
-
if (overrideFilePath) {
|
|
99
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.overrideFilePathTitle`));
|
|
100
|
-
logger_1.logger.log(`${(0, index_1.indent)(1)}${(0, lang_1.i18n)(`${i18nKey}.overrideFilePath`, { overrideFilePath })}`);
|
|
101
|
-
logger_1.logger.log(`${(0, index_1.indent)(1)}${(0, lang_1.i18n)(`${i18nKey}.overrideAccount`, {
|
|
102
|
-
account: (0, config_1.getConfigDefaultAccount)(),
|
|
103
|
-
})}`);
|
|
104
|
-
logger_1.logger.log('');
|
|
105
|
-
}
|
|
106
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.accounts`));
|
|
83
|
+
logger_1.logger.log((0, lang_1.i18n)('commands.account.subcommands.list.configPath', { configPath: configPath }));
|
|
84
|
+
logger_1.logger.log((0, lang_1.i18n)('commands.account.subcommands.list.defaultAccount', {
|
|
85
|
+
account: (0, config_1.getConfigDefaultAccount)(),
|
|
86
|
+
}));
|
|
87
|
+
logger_1.logger.log((0, lang_1.i18n)('commands.account.subcommands.list.accounts'));
|
|
107
88
|
logger_1.logger.log((0, table_1.getTableContents)(accountData, { border: { bodyLeft: ' ' } }));
|
|
108
89
|
}
|
|
109
90
|
function builder(yargs) {
|
|
@@ -1,68 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.describe = exports.command = void 0;
|
|
7
4
|
exports.handler = handler;
|
|
8
5
|
exports.builder = builder;
|
|
9
|
-
const fs_1 = __importDefault(require("fs"));
|
|
10
6
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
11
7
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
12
8
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
13
9
|
const lang_1 = require("../../lib/lang");
|
|
14
|
-
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
15
|
-
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
16
10
|
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
17
11
|
const commonOpts_1 = require("../../lib/commonOpts");
|
|
18
|
-
const i18nKey = 'commands.account.subcommands.remove';
|
|
19
12
|
exports.command = 'remove [account]';
|
|
20
|
-
exports.describe = (0, lang_1.i18n)(
|
|
13
|
+
exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.remove.describe`);
|
|
21
14
|
async function handler(args) {
|
|
22
15
|
const { account } = args;
|
|
23
16
|
let accountToRemove = account;
|
|
24
17
|
if (accountToRemove && !(0, config_1.getAccountId)(accountToRemove)) {
|
|
25
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
18
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.account.subcommands.remove.errors.accountNotFound`, {
|
|
26
19
|
specifiedAccount: accountToRemove,
|
|
27
20
|
configPath: (0, config_1.getConfigPath)(),
|
|
28
21
|
}));
|
|
29
22
|
}
|
|
30
23
|
if (!accountToRemove || !(0, config_1.getAccountId)(accountToRemove)) {
|
|
31
|
-
accountToRemove = await (0, accountsPrompt_1.selectAccountFromConfig)((0, lang_1.i18n)(
|
|
24
|
+
accountToRemove = await (0, accountsPrompt_1.selectAccountFromConfig)((0, lang_1.i18n)(`commands.account.subcommands.remove.prompts.selectAccountToRemove`));
|
|
32
25
|
}
|
|
33
26
|
(0, usageTracking_1.trackCommandUsage)('accounts-remove', undefined, (0, config_1.getAccountId)(accountToRemove));
|
|
34
27
|
const currentDefaultAccount = (0, config_1.getConfigDefaultAccount)();
|
|
35
|
-
const accountOverride = (0, config_1.getCWDAccountOverride)();
|
|
36
|
-
const overrideFilePath = (0, config_1.getDefaultAccountOverrideFilePath)();
|
|
37
|
-
if (overrideFilePath &&
|
|
38
|
-
accountOverride &&
|
|
39
|
-
accountOverride === accountToRemove) {
|
|
40
|
-
const { deleteOverrideFile } = await (0, promptUtils_1.promptUser)({
|
|
41
|
-
type: 'confirm',
|
|
42
|
-
name: 'deleteOverrideFile',
|
|
43
|
-
message: (0, lang_1.i18n)(`${i18nKey}.prompts.deleteOverrideFile`, {
|
|
44
|
-
overrideFilePath,
|
|
45
|
-
accountName: accountToRemove,
|
|
46
|
-
}),
|
|
47
|
-
});
|
|
48
|
-
try {
|
|
49
|
-
if (deleteOverrideFile) {
|
|
50
|
-
fs_1.default.unlinkSync(overrideFilePath);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
(0, errorHandlers_1.logError)(error);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
28
|
await (0, config_1.deleteAccount)(accountToRemove);
|
|
58
|
-
logger_1.logger.success((0, lang_1.i18n)(
|
|
29
|
+
logger_1.logger.success((0, lang_1.i18n)(`commands.account.subcommands.remove.success.accountRemoved`, {
|
|
59
30
|
accountName: accountToRemove,
|
|
60
31
|
}));
|
|
61
32
|
// Get updated version of the config
|
|
62
33
|
(0, config_1.loadConfig)((0, config_1.getConfigPath)());
|
|
63
34
|
if (accountToRemove === currentDefaultAccount) {
|
|
64
35
|
logger_1.logger.log();
|
|
65
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
36
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.remove.logs.replaceDefaultAccount`));
|
|
66
37
|
const newDefaultAccount = await (0, accountsPrompt_1.selectAccountFromConfig)();
|
|
67
38
|
(0, config_1.updateDefaultAccount)(newDefaultAccount);
|
|
68
39
|
}
|
|
@@ -70,12 +41,12 @@ async function handler(args) {
|
|
|
70
41
|
function builder(yargs) {
|
|
71
42
|
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
72
43
|
yargs.positional('account', {
|
|
73
|
-
describe: (0, lang_1.i18n)(
|
|
44
|
+
describe: (0, lang_1.i18n)(`commands.account.subcommands.remove.options.account.describe`),
|
|
74
45
|
type: 'string',
|
|
75
46
|
});
|
|
76
47
|
yargs.example([
|
|
77
|
-
['$0 accounts remove', (0, lang_1.i18n)(
|
|
78
|
-
['$0 accounts remove MyAccount', (0, lang_1.i18n)(
|
|
48
|
+
['$0 accounts remove', (0, lang_1.i18n)(`commands.account.subcommands.remove.examples.default`)],
|
|
49
|
+
['$0 accounts remove MyAccount', (0, lang_1.i18n)(`commands.account.subcommands.remove.examples.byName`)],
|
|
79
50
|
]);
|
|
80
51
|
return yargs;
|
|
81
52
|
}
|
|
@@ -10,9 +10,8 @@ const usageTracking_1 = require("../../lib/usageTracking");
|
|
|
10
10
|
const lang_1 = require("../../lib/lang");
|
|
11
11
|
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
12
12
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
13
|
-
const i18nKey = 'commands.account.subcommands.rename';
|
|
14
13
|
exports.command = 'rename <account-name> <new-name>';
|
|
15
|
-
exports.describe = (0, lang_1.i18n)(
|
|
14
|
+
exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.rename.describe`);
|
|
16
15
|
async function handler(args) {
|
|
17
16
|
const { accountName, newName, derivedAccountId } = args;
|
|
18
17
|
(0, usageTracking_1.trackCommandUsage)('accounts-rename', undefined, derivedAccountId);
|
|
@@ -23,7 +22,7 @@ async function handler(args) {
|
|
|
23
22
|
(0, errorHandlers_1.logError)(error);
|
|
24
23
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
25
24
|
}
|
|
26
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
25
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.rename.success.renamed`, {
|
|
27
26
|
name: accountName,
|
|
28
27
|
newName,
|
|
29
28
|
}));
|
|
@@ -33,11 +32,11 @@ function builder(yargs) {
|
|
|
33
32
|
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
34
33
|
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
35
34
|
yargs.positional('account-name', {
|
|
36
|
-
describe: (0, lang_1.i18n)(
|
|
35
|
+
describe: (0, lang_1.i18n)(`commands.account.subcommands.rename.positionals.accountName.describe`),
|
|
37
36
|
type: 'string',
|
|
38
37
|
});
|
|
39
38
|
yargs.positional('new-name', {
|
|
40
|
-
describe: (0, lang_1.i18n)(
|
|
39
|
+
describe: (0, lang_1.i18n)(`commands.account.subcommands.rename.positionals.newName.describe`),
|
|
41
40
|
type: 'string',
|
|
42
41
|
});
|
|
43
42
|
yargs.example([
|
package/commands/account/use.js
CHANGED
|
@@ -8,49 +8,35 @@ const config_1 = require("@hubspot/local-dev-lib/config");
|
|
|
8
8
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
9
9
|
const lang_1 = require("../../lib/lang");
|
|
10
10
|
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
11
|
-
const ui_1 = require("../../lib/ui");
|
|
12
|
-
const i18nKey = 'commands.account.subcommands.use';
|
|
13
11
|
exports.command = 'use [account]';
|
|
14
|
-
exports.describe = (0, lang_1.i18n)(
|
|
12
|
+
exports.describe = (0, lang_1.i18n)('commands.account.subcommands.use.describe');
|
|
15
13
|
async function handler(args) {
|
|
16
14
|
let newDefaultAccount = args.account;
|
|
17
15
|
if (!newDefaultAccount) {
|
|
18
16
|
newDefaultAccount = await (0, accountsPrompt_1.selectAccountFromConfig)();
|
|
19
17
|
}
|
|
20
18
|
else if (!(0, config_1.getAccountId)(newDefaultAccount)) {
|
|
21
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
19
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.account.subcommands.use.errors.accountNotFound', {
|
|
22
20
|
specifiedAccount: newDefaultAccount,
|
|
23
21
|
configPath: (0, config_1.getConfigPath)(),
|
|
24
22
|
}));
|
|
25
23
|
newDefaultAccount = await (0, accountsPrompt_1.selectAccountFromConfig)();
|
|
26
24
|
}
|
|
27
25
|
(0, usageTracking_1.trackCommandUsage)('accounts-use', undefined, (0, config_1.getAccountId)(newDefaultAccount));
|
|
28
|
-
const accountOverride = (0, config_1.getCWDAccountOverride)();
|
|
29
|
-
const overrideFilePath = (0, config_1.getDefaultAccountOverrideFilePath)();
|
|
30
|
-
if (accountOverride && overrideFilePath) {
|
|
31
|
-
logger_1.logger.warn((0, lang_1.i18n)(`${i18nKey}.accountOverride`, {
|
|
32
|
-
accountOverride,
|
|
33
|
-
}));
|
|
34
|
-
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.accountOverrideCommands`, {
|
|
35
|
-
createOverrideCommand: (0, ui_1.uiCommandReference)('hs account create-override'),
|
|
36
|
-
removeOverrideCommand: (0, ui_1.uiCommandReference)('hs account remove-override'),
|
|
37
|
-
}));
|
|
38
|
-
logger_1.logger.log('');
|
|
39
|
-
}
|
|
40
26
|
(0, config_1.updateDefaultAccount)(newDefaultAccount);
|
|
41
|
-
return logger_1.logger.success((0, lang_1.i18n)(
|
|
27
|
+
return logger_1.logger.success((0, lang_1.i18n)('commands.account.subcommands.use.success.defaultAccountUpdated', {
|
|
42
28
|
accountName: newDefaultAccount,
|
|
43
29
|
}));
|
|
44
30
|
}
|
|
45
31
|
function builder(yargs) {
|
|
46
32
|
yargs.positional('account', {
|
|
47
|
-
describe: (0, lang_1.i18n)(
|
|
33
|
+
describe: (0, lang_1.i18n)('commands.account.subcommands.use.options.account.describe'),
|
|
48
34
|
type: 'string',
|
|
49
35
|
});
|
|
50
36
|
yargs.example([
|
|
51
|
-
['$0 accounts use', (0, lang_1.i18n)(
|
|
52
|
-
['$0 accounts use MyAccount', (0, lang_1.i18n)(
|
|
53
|
-
['$0 accounts use 1234567', (0, lang_1.i18n)(
|
|
37
|
+
['$0 accounts use', (0, lang_1.i18n)('commands.account.subcommands.use.examples.default')],
|
|
38
|
+
['$0 accounts use MyAccount', (0, lang_1.i18n)('commands.account.subcommands.use.examples.nameBased')],
|
|
39
|
+
['$0 accounts use 1234567', (0, lang_1.i18n)('commands.account.subcommands.use.examples.idBased')],
|
|
54
40
|
]);
|
|
55
41
|
return yargs;
|
|
56
42
|
}
|
package/commands/account.js
CHANGED
|
@@ -37,30 +37,24 @@ exports.describe = exports.command = void 0;
|
|
|
37
37
|
exports.builder = builder;
|
|
38
38
|
const commonOpts_1 = require("../lib/commonOpts");
|
|
39
39
|
const lang_1 = require("../lib/lang");
|
|
40
|
-
const auth = __importStar(require("./account/auth"));
|
|
41
40
|
const list = __importStar(require("./account/list"));
|
|
42
41
|
const rename = __importStar(require("./account/rename"));
|
|
43
42
|
const use = __importStar(require("./account/use"));
|
|
44
43
|
const info = __importStar(require("./account/info"));
|
|
45
44
|
const remove = __importStar(require("./account/remove"));
|
|
46
45
|
const clean = __importStar(require("./account/clean"));
|
|
47
|
-
const createOverride = __importStar(require("./account/createOverride"));
|
|
48
|
-
const removeOverride = __importStar(require("./account/removeOverride"));
|
|
49
46
|
const i18nKey = 'commands.account';
|
|
50
47
|
exports.command = ['account', 'accounts'];
|
|
51
48
|
exports.describe = (0, lang_1.i18n)(`${i18nKey}.describe`);
|
|
52
49
|
function builder(yargs) {
|
|
53
50
|
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
54
51
|
yargs
|
|
55
|
-
.command(auth)
|
|
56
52
|
.command(list)
|
|
57
53
|
.command(rename)
|
|
58
54
|
.command(use)
|
|
59
55
|
.command(info)
|
|
60
56
|
.command(remove)
|
|
61
57
|
.command(clean)
|
|
62
|
-
.command(createOverride)
|
|
63
|
-
.command(removeOverride)
|
|
64
58
|
.demandCommand(1, '');
|
|
65
59
|
return yargs;
|
|
66
60
|
}
|
package/commands/auth.js
CHANGED
|
@@ -47,12 +47,8 @@ async function handler(args) {
|
|
|
47
47
|
if (configPath) {
|
|
48
48
|
(0, git_1.checkAndWarnGitInclusion)(configPath);
|
|
49
49
|
}
|
|
50
|
-
if ((0, config_2.
|
|
51
|
-
|
|
52
|
-
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.errors.globalConfigFileExists`, {
|
|
53
|
-
configPath: globalConfigPath,
|
|
54
|
-
authCommand: (0, ui_1.uiCommandReference)('hs account auth'),
|
|
55
|
-
}));
|
|
50
|
+
if (!(0, config_2.getConfigPath)(configFlagValue)) {
|
|
51
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.errors.noConfigFileFound`));
|
|
56
52
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
57
53
|
}
|
|
58
54
|
(0, usageTracking_1.trackCommandUsage)('auth');
|