@hubspot/cli 3.0.10-beta.6 → 3.0.10
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/README.md +7 -1
- package/bin/cli.js +3 -4
- package/commands/accounts/list.js +18 -26
- package/commands/accounts/rename.js +13 -24
- package/commands/accounts.js +4 -1
- package/commands/auth.js +33 -16
- package/commands/config/set/allowUsageTracking.js +17 -33
- package/commands/config/set/defaultAccount.js +24 -34
- package/commands/config/set/defaultMode.js +25 -44
- package/commands/config/set/httpTimeout.js +10 -28
- package/commands/config/set.js +4 -1
- package/commands/config.js +4 -1
- package/commands/create/api-sample.js +20 -14
- package/commands/create/function.js +3 -1
- package/commands/create/index.js +0 -1
- package/commands/create/module.js +20 -7
- package/commands/create/template.js +22 -5
- package/commands/create/website-theme.js +12 -1
- package/commands/create.js +23 -8
- package/commands/customObject/create.js +22 -24
- package/commands/customObject/schema/create.js +30 -28
- package/commands/customObject/schema/delete.js +20 -20
- package/commands/customObject/schema/fetch-all.js +17 -24
- package/commands/customObject/schema/fetch.js +29 -24
- package/commands/customObject/schema/list.js +8 -17
- package/commands/customObject/schema/update.js +31 -29
- package/commands/customObject/schema.js +4 -1
- package/commands/customObject.js +10 -21
- package/commands/fetch.js +15 -30
- package/commands/filemanager/fetch.js +13 -25
- package/commands/filemanager/upload.js +47 -35
- package/commands/filemanager.js +4 -1
- package/commands/functions/deploy.js +34 -37
- package/commands/functions/list.js +9 -24
- package/commands/functions/server.js +13 -29
- package/commands/functions.js +4 -1
- package/commands/hubdb/clear.js +25 -21
- package/commands/hubdb/create.js +25 -22
- package/commands/hubdb/delete.js +19 -20
- package/commands/hubdb/fetch.js +15 -20
- package/commands/hubdb.js +4 -1
- package/commands/init.js +25 -13
- package/commands/lint.js +14 -23
- package/commands/list.js +19 -25
- package/commands/logs.js +23 -44
- package/commands/mv.js +21 -25
- package/commands/open.js +9 -7
- package/commands/project/create.js +26 -42
- package/commands/project/deploy.js +35 -36
- package/commands/project/listBuilds.js +160 -0
- package/commands/project/logs.js +87 -79
- package/commands/project/upload.js +74 -78
- package/commands/project/watch.js +103 -0
- package/commands/project.js +5 -6
- package/commands/remove.js +12 -20
- package/commands/sandbox/create.js +18 -13
- package/commands/secrets/addSecret.js +19 -22
- package/commands/secrets/deleteSecret.js +18 -21
- package/commands/secrets/listSecrets.js +10 -19
- package/commands/secrets/updateSecret.js +19 -22
- package/commands/secrets.js +4 -1
- package/commands/server.js +15 -6
- package/commands/{marketplaceValidate/validateTheme.js → theme/marketplace-validate.js} +26 -24
- package/commands/theme.js +5 -3
- package/commands/upload.js +66 -45
- package/commands/watch.js +33 -55
- package/lib/commonOpts.js +14 -11
- package/lib/enums/exitCodes.js +14 -0
- package/lib/links.js +0 -10
- package/lib/projects.js +121 -77
- package/lib/{createApiSamplePrompt.js → prompts/createApiSamplePrompt.js} +10 -11
- package/lib/{createFunctionPrompt.js → prompts/createFunctionPrompt.js} +27 -21
- package/lib/{createModulePrompt.js → prompts/createModulePrompt.js} +12 -9
- package/lib/prompts/createProjectPrompt.js +68 -0
- package/lib/{createTemplatePrompt.js → prompts/createTemplatePrompt.js} +7 -4
- package/lib/prompts/folderOverwritePrompt.js +17 -0
- package/lib/{prompts.js → prompts/personalAccessKeyPrompt.js} +25 -42
- package/lib/prompts/promptUtils.js +10 -0
- package/lib/prompts/sandboxesPrompt.js +24 -0
- package/lib/prompts/secretPrompt.js +25 -0
- package/lib/serverlessLogs.js +4 -3
- package/lib/ui.js +48 -0
- package/lib/validation.js +4 -3
- package/package.json +8 -7
- package/commands/app/deploy.js +0 -116
- package/commands/app.js +0 -14
- package/commands/create/project.js +0 -25
- package/lib/prompts/projects.js +0 -40
- package/lib/prompts/sandboxes.js +0 -22
- package/lib/secretPrompt.js +0 -22
package/commands/upload.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
loadConfig,
|
|
6
|
-
uploadFolder,
|
|
7
|
-
validateConfig,
|
|
8
|
-
checkAndWarnGitInclusion,
|
|
9
|
-
} = require('@hubspot/cli-lib');
|
|
4
|
+
const { uploadFolder } = require('@hubspot/cli-lib');
|
|
10
5
|
const { getFileMapperQueryValues } = require('@hubspot/cli-lib/fileMapper');
|
|
11
6
|
const { upload } = require('@hubspot/cli-lib/api/fileMapper');
|
|
12
7
|
const {
|
|
@@ -28,45 +23,39 @@ const {
|
|
|
28
23
|
addAccountOptions,
|
|
29
24
|
addModeOptions,
|
|
30
25
|
addUseEnvironmentOptions,
|
|
31
|
-
setLogLevel,
|
|
32
26
|
getAccountId,
|
|
33
27
|
getMode,
|
|
34
28
|
} = require('../lib/commonOpts');
|
|
35
|
-
const {
|
|
36
|
-
const { validateAccount, validateMode } = require('../lib/validation');
|
|
29
|
+
const { validateMode, loadAndValidateOptions } = require('../lib/validation');
|
|
37
30
|
const { trackCommandUsage } = require('../lib/usageTracking');
|
|
38
31
|
const { getThemePreviewUrl } = require('@hubspot/cli-lib/lib/files');
|
|
32
|
+
const { i18n } = require('@hubspot/cli-lib/lib/lang');
|
|
33
|
+
|
|
34
|
+
const i18nKey = 'cli.commands.upload';
|
|
35
|
+
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
39
36
|
|
|
40
37
|
exports.command = 'upload <src> <dest>';
|
|
41
|
-
exports.describe =
|
|
42
|
-
'Upload a folder or file from your computer to the HubSpot CMS';
|
|
38
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
43
39
|
|
|
44
40
|
const logThemePreview = (filePath, accountId) => {
|
|
45
41
|
const previewUrl = getThemePreviewUrl(filePath, accountId);
|
|
46
42
|
// Only log if we are actually in a theme
|
|
47
43
|
if (previewUrl) {
|
|
48
|
-
logger.log(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
logger.log(
|
|
45
|
+
i18n(`${i18nKey}.previewUrl`, {
|
|
46
|
+
previewUrl,
|
|
47
|
+
})
|
|
48
|
+
);
|
|
52
49
|
}
|
|
53
50
|
};
|
|
54
51
|
|
|
55
52
|
exports.handler = async options => {
|
|
56
|
-
const { src, dest
|
|
57
|
-
setLogLevel(options);
|
|
58
|
-
logDebugInfo(options);
|
|
59
|
-
loadConfig(configPath, options);
|
|
60
|
-
checkAndWarnGitInclusion();
|
|
53
|
+
const { src, dest } = options;
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
validateMode(options)
|
|
67
|
-
)
|
|
68
|
-
) {
|
|
69
|
-
process.exit(1);
|
|
55
|
+
await loadAndValidateOptions(options);
|
|
56
|
+
|
|
57
|
+
if (!validateMode(options)) {
|
|
58
|
+
process.exit(EXIT_CODES.ERROR);
|
|
70
59
|
}
|
|
71
60
|
|
|
72
61
|
const accountId = getAccountId(options);
|
|
@@ -76,16 +65,24 @@ exports.handler = async options => {
|
|
|
76
65
|
try {
|
|
77
66
|
stats = fs.statSync(absoluteSrcPath);
|
|
78
67
|
if (!stats.isFile() && !stats.isDirectory()) {
|
|
79
|
-
logger.error(
|
|
68
|
+
logger.error(
|
|
69
|
+
i18n(`${i18nKey}.errors.invalidPath`, {
|
|
70
|
+
path: src,
|
|
71
|
+
})
|
|
72
|
+
);
|
|
80
73
|
return;
|
|
81
74
|
}
|
|
82
75
|
} catch (e) {
|
|
83
|
-
logger.error(
|
|
76
|
+
logger.error(
|
|
77
|
+
i18n(`${i18nKey}.errors.invalidPath`, {
|
|
78
|
+
path: src,
|
|
79
|
+
})
|
|
80
|
+
);
|
|
84
81
|
return;
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
if (!dest) {
|
|
88
|
-
logger.error(
|
|
85
|
+
logger.error(i18n(`${i18nKey}.errors.destinationRequired`));
|
|
89
86
|
return;
|
|
90
87
|
}
|
|
91
88
|
const normalizedDest = convertToUnixPath(dest);
|
|
@@ -101,16 +98,24 @@ exports.handler = async options => {
|
|
|
101
98
|
|
|
102
99
|
if (srcDestIssues.length) {
|
|
103
100
|
srcDestIssues.forEach(({ message }) => logger.error(message));
|
|
104
|
-
process.exit(
|
|
101
|
+
process.exit(EXIT_CODES.ERROR);
|
|
105
102
|
}
|
|
106
103
|
if (stats.isFile()) {
|
|
107
104
|
if (!isAllowedExtension(src)) {
|
|
108
|
-
logger.error(
|
|
105
|
+
logger.error(
|
|
106
|
+
i18n(`${i18nKey}.errors.invalidPath`, {
|
|
107
|
+
path: src,
|
|
108
|
+
})
|
|
109
|
+
);
|
|
109
110
|
return;
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
if (shouldIgnoreFile(absoluteSrcPath)) {
|
|
113
|
-
logger.error(
|
|
114
|
+
logger.error(
|
|
115
|
+
i18n(`${i18nKey}.errors.fileIgnored`, {
|
|
116
|
+
path: src,
|
|
117
|
+
})
|
|
118
|
+
);
|
|
114
119
|
return;
|
|
115
120
|
}
|
|
116
121
|
|
|
@@ -122,15 +127,21 @@ exports.handler = async options => {
|
|
|
122
127
|
)
|
|
123
128
|
.then(() => {
|
|
124
129
|
logger.success(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
i18n(`${i18nKey}.success.fileUploaded`, {
|
|
131
|
+
accountId,
|
|
132
|
+
dest: normalizedDest,
|
|
133
|
+
src,
|
|
134
|
+
})
|
|
129
135
|
);
|
|
130
136
|
logThemePreview(src, accountId);
|
|
131
137
|
})
|
|
132
138
|
.catch(error => {
|
|
133
|
-
logger.error(
|
|
139
|
+
logger.error(
|
|
140
|
+
i18n(`${i18nKey}.errors.uploadFailed`, {
|
|
141
|
+
dest: normalizedDest,
|
|
142
|
+
src,
|
|
143
|
+
})
|
|
144
|
+
);
|
|
134
145
|
logApiUploadErrorInstance(
|
|
135
146
|
error,
|
|
136
147
|
new ApiErrorContext({
|
|
@@ -142,19 +153,30 @@ exports.handler = async options => {
|
|
|
142
153
|
});
|
|
143
154
|
} else {
|
|
144
155
|
logger.log(
|
|
145
|
-
|
|
156
|
+
i18n(`${i18nKey}.uploading`, {
|
|
157
|
+
accountId,
|
|
158
|
+
dest,
|
|
159
|
+
src,
|
|
160
|
+
})
|
|
146
161
|
);
|
|
147
162
|
uploadFolder(accountId, absoluteSrcPath, dest, {
|
|
148
163
|
mode,
|
|
149
164
|
})
|
|
150
165
|
.then(() => {
|
|
151
166
|
logger.success(
|
|
152
|
-
|
|
167
|
+
i18n(`${i18nKey}.success.uploadComplete`, {
|
|
168
|
+
dest,
|
|
169
|
+
})
|
|
153
170
|
);
|
|
154
171
|
logThemePreview(src, accountId);
|
|
155
172
|
})
|
|
156
173
|
.catch(error => {
|
|
157
|
-
logger.error(
|
|
174
|
+
logger.error(
|
|
175
|
+
i18n(`${i18nKey}.errors.uploadFailed`, {
|
|
176
|
+
dest,
|
|
177
|
+
src,
|
|
178
|
+
})
|
|
179
|
+
);
|
|
158
180
|
logErrorInstance(error, {
|
|
159
181
|
accountId,
|
|
160
182
|
});
|
|
@@ -169,12 +191,11 @@ exports.builder = yargs => {
|
|
|
169
191
|
addUseEnvironmentOptions(yargs, true);
|
|
170
192
|
|
|
171
193
|
yargs.positional('src', {
|
|
172
|
-
describe:
|
|
173
|
-
'Path to the local file, relative to your current working directory.',
|
|
194
|
+
describe: i18n(`${i18nKey}.positionals.src.describe`),
|
|
174
195
|
type: 'string',
|
|
175
196
|
});
|
|
176
197
|
yargs.positional('dest', {
|
|
177
|
-
describe:
|
|
198
|
+
describe: i18n(`${i18nKey}.positionals.dest.describe`),
|
|
178
199
|
type: 'string',
|
|
179
200
|
});
|
|
180
201
|
return yargs;
|
package/commands/watch.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
watch,
|
|
6
|
-
loadConfig,
|
|
7
|
-
validateConfig,
|
|
8
|
-
checkAndWarnGitInclusion,
|
|
9
|
-
} = require('@hubspot/cli-lib');
|
|
4
|
+
const { watch } = require('@hubspot/cli-lib');
|
|
10
5
|
const { getCwd } = require('@hubspot/cli-lib/path');
|
|
11
6
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
12
7
|
|
|
@@ -15,42 +10,26 @@ const {
|
|
|
15
10
|
addAccountOptions,
|
|
16
11
|
addModeOptions,
|
|
17
12
|
addUseEnvironmentOptions,
|
|
18
|
-
setLogLevel,
|
|
19
13
|
getAccountId,
|
|
20
14
|
getMode,
|
|
21
15
|
} = require('../lib/commonOpts');
|
|
22
|
-
const {
|
|
23
|
-
const { validateAccount, validateMode } = require('../lib/validation');
|
|
16
|
+
const { validateMode, loadAndValidateOptions } = require('../lib/validation');
|
|
24
17
|
const { trackCommandUsage } = require('../lib/usageTracking');
|
|
18
|
+
const { i18n } = require('@hubspot/cli-lib/lib/lang');
|
|
19
|
+
|
|
20
|
+
const i18nKey = 'cli.commands.watch';
|
|
21
|
+
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
25
22
|
|
|
26
23
|
exports.command = 'watch <src> <dest>';
|
|
27
|
-
exports.describe =
|
|
28
|
-
'Watch a directory on your computer for changes and upload the changed files to the HubSpot CMS';
|
|
24
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
29
25
|
|
|
30
26
|
exports.handler = async options => {
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
disableInitial,
|
|
38
|
-
notify,
|
|
39
|
-
} = options;
|
|
40
|
-
|
|
41
|
-
setLogLevel(options);
|
|
42
|
-
logDebugInfo(options);
|
|
43
|
-
loadConfig(configPath, options);
|
|
44
|
-
checkAndWarnGitInclusion();
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
!(
|
|
48
|
-
validateConfig() &&
|
|
49
|
-
(await validateAccount(options)) &&
|
|
50
|
-
validateMode(options)
|
|
51
|
-
)
|
|
52
|
-
) {
|
|
53
|
-
process.exit(1);
|
|
27
|
+
const { src, dest, remove, initialUpload, disableInitial, notify } = options;
|
|
28
|
+
|
|
29
|
+
await loadAndValidateOptions(options);
|
|
30
|
+
|
|
31
|
+
if (!validateMode(options)) {
|
|
32
|
+
process.exit(EXIT_CODES.ERROR);
|
|
54
33
|
}
|
|
55
34
|
|
|
56
35
|
const accountId = getAccountId(options);
|
|
@@ -60,32 +39,34 @@ exports.handler = async options => {
|
|
|
60
39
|
try {
|
|
61
40
|
const stats = fs.statSync(absoluteSrcPath);
|
|
62
41
|
if (!stats.isDirectory()) {
|
|
63
|
-
logger.log(
|
|
42
|
+
logger.log(
|
|
43
|
+
i18n(`${i18nKey}.errors.invalidPath`, {
|
|
44
|
+
path: src,
|
|
45
|
+
})
|
|
46
|
+
);
|
|
64
47
|
return;
|
|
65
48
|
}
|
|
66
49
|
} catch (e) {
|
|
67
|
-
logger.log(
|
|
50
|
+
logger.log(
|
|
51
|
+
i18n(`${i18nKey}.errors.invalidPath`, {
|
|
52
|
+
path: src,
|
|
53
|
+
})
|
|
54
|
+
);
|
|
68
55
|
return;
|
|
69
56
|
}
|
|
70
57
|
|
|
71
58
|
if (!dest) {
|
|
72
|
-
logger.log(
|
|
59
|
+
logger.log(i18n(`${i18nKey}.errors.destinationRequired`));
|
|
73
60
|
return;
|
|
74
61
|
}
|
|
75
62
|
|
|
76
63
|
if (disableInitial) {
|
|
77
|
-
logger.info(
|
|
78
|
-
'Passing the "--disable-initial" option is no longer necessary. Running "hs watch" no longer uploads the watched directory by default.'
|
|
79
|
-
);
|
|
64
|
+
logger.info(i18n(`${i18nKey}.warnings.disableInitial`));
|
|
80
65
|
} else {
|
|
81
|
-
logger.info(
|
|
82
|
-
`The "watch" command no longer uploads the watched directory when started. The directory "${src}" was not uploaded.`
|
|
83
|
-
);
|
|
66
|
+
logger.info(i18n(`${i18nKey}.warnings.notUploaded`, { path: src }));
|
|
84
67
|
|
|
85
68
|
if (!initialUpload) {
|
|
86
|
-
logger.info(
|
|
87
|
-
'To upload the directory run "hs upload" beforehand or add the "--initial-upload" option when running "hs watch".'
|
|
88
|
-
);
|
|
69
|
+
logger.info(i18n(`${i18nKey}.warnings.initialUpload`));
|
|
89
70
|
}
|
|
90
71
|
}
|
|
91
72
|
|
|
@@ -105,35 +86,32 @@ exports.builder = yargs => {
|
|
|
105
86
|
addUseEnvironmentOptions(yargs, true);
|
|
106
87
|
|
|
107
88
|
yargs.positional('src', {
|
|
108
|
-
describe:
|
|
109
|
-
'Path to the local directory your files are in, relative to your current working directory',
|
|
89
|
+
describe: i18n(`${i18nKey}.positionals.src.describe`),
|
|
110
90
|
type: 'string',
|
|
111
91
|
});
|
|
112
92
|
yargs.positional('dest', {
|
|
113
|
-
describe:
|
|
93
|
+
describe: i18n(`${i18nKey}.positionals.dest.describe`),
|
|
114
94
|
type: 'string',
|
|
115
95
|
});
|
|
116
96
|
yargs.option('remove', {
|
|
117
97
|
alias: 'r',
|
|
118
|
-
describe:
|
|
119
|
-
'Will cause watch to delete files in your HubSpot account that are not found locally.',
|
|
98
|
+
describe: i18n(`${i18nKey}.options.remove.describe`),
|
|
120
99
|
type: 'boolean',
|
|
121
100
|
});
|
|
122
101
|
yargs.option('initial-upload', {
|
|
123
102
|
alias: 'i',
|
|
124
|
-
describe:
|
|
103
|
+
describe: i18n(`${i18nKey}.options.initialUpload.describe`),
|
|
125
104
|
type: 'boolean',
|
|
126
105
|
});
|
|
127
106
|
yargs.option('disable-initial', {
|
|
128
107
|
alias: 'd',
|
|
129
|
-
describe:
|
|
108
|
+
describe: i18n(`${i18nKey}.options.disableInitial.describe`),
|
|
130
109
|
type: 'boolean',
|
|
131
110
|
hidden: true,
|
|
132
111
|
});
|
|
133
112
|
yargs.option('notify', {
|
|
134
113
|
alias: 'n',
|
|
135
|
-
describe:
|
|
136
|
-
'Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file',
|
|
114
|
+
describe: i18n(`${i18nKey}.options.notify.describe`),
|
|
137
115
|
type: 'string',
|
|
138
116
|
requiresArg: true,
|
|
139
117
|
});
|
package/lib/commonOpts.js
CHANGED
|
@@ -6,48 +6,51 @@ const {
|
|
|
6
6
|
DEFAULT_MODE,
|
|
7
7
|
Mode,
|
|
8
8
|
} = require('@hubspot/cli-lib');
|
|
9
|
+
const { i18n } = require('@hubspot/cli-lib/lib/lang');
|
|
10
|
+
|
|
11
|
+
const i18nKey = 'cli.lib.commonOpts';
|
|
9
12
|
const { LOG_LEVEL } = Logger;
|
|
10
13
|
|
|
11
14
|
const addAccountOptions = program =>
|
|
12
15
|
program.option('portal', {
|
|
13
16
|
alias: ['p', 'account', 'a'],
|
|
14
|
-
describe:
|
|
17
|
+
describe: i18n(`${i18nKey}.options.portal.describe`),
|
|
15
18
|
type: 'string',
|
|
16
19
|
});
|
|
17
20
|
|
|
18
21
|
const addConfigOptions = yargs =>
|
|
19
22
|
yargs.option('config', {
|
|
20
23
|
alias: 'c',
|
|
21
|
-
describe:
|
|
24
|
+
describe: i18n(`${i18nKey}.options.config.describe`),
|
|
22
25
|
type: 'string',
|
|
23
26
|
});
|
|
24
27
|
|
|
25
28
|
const addOverwriteOptions = yargs =>
|
|
26
29
|
yargs.option('overwrite', {
|
|
27
30
|
alias: 'o',
|
|
28
|
-
describe:
|
|
31
|
+
describe: i18n(`${i18nKey}.options.overwrite.describe`),
|
|
29
32
|
type: 'boolean',
|
|
30
33
|
default: false,
|
|
31
34
|
});
|
|
32
35
|
|
|
33
36
|
const addModeOptions = (yargs, { read, write }) => {
|
|
34
37
|
const modes = `<${Object.values(Mode).join(' | ')}>`;
|
|
35
|
-
const help = read
|
|
36
|
-
? `read from ${modes}`
|
|
37
|
-
: write
|
|
38
|
-
? `write to ${modes}`
|
|
39
|
-
: `${modes}`;
|
|
40
38
|
|
|
41
39
|
return yargs.option('mode', {
|
|
42
40
|
alias: 'm',
|
|
43
|
-
describe:
|
|
41
|
+
describe: i18n(
|
|
42
|
+
`${i18nKey}.options.modes.describe.${
|
|
43
|
+
read ? 'read' : write ? 'write' : 'default'
|
|
44
|
+
}`,
|
|
45
|
+
{ modes }
|
|
46
|
+
),
|
|
44
47
|
type: 'string',
|
|
45
48
|
});
|
|
46
49
|
};
|
|
47
50
|
|
|
48
51
|
const addTestingOptions = yargs =>
|
|
49
52
|
yargs.option('qa', {
|
|
50
|
-
describe:
|
|
53
|
+
describe: i18n(`${i18nKey}.options.qa.describe`),
|
|
51
54
|
type: 'boolean',
|
|
52
55
|
default: false,
|
|
53
56
|
hidden: true,
|
|
@@ -55,7 +58,7 @@ const addTestingOptions = yargs =>
|
|
|
55
58
|
|
|
56
59
|
const addUseEnvironmentOptions = yargs =>
|
|
57
60
|
yargs.option('use-env', {
|
|
58
|
-
describe:
|
|
61
|
+
describe: i18n(`${i18nKey}.options.useEnv.describe`),
|
|
59
62
|
type: 'boolean',
|
|
60
63
|
default: false,
|
|
61
64
|
});
|
package/lib/links.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const supportsHyperlinks = require('supports-hyperlinks');
|
|
2
1
|
const { getEnv } = require('@hubspot/cli-lib/lib/config');
|
|
3
2
|
const { ENVIRONMENTS } = require('@hubspot/cli-lib/lib/constants');
|
|
4
3
|
const { getHubSpotWebsiteOrigin } = require('@hubspot/cli-lib/lib/urls');
|
|
@@ -121,18 +120,9 @@ const openLink = (accountId, shortcut) => {
|
|
|
121
120
|
logger.success(`We opened ${match.url} in your browser`);
|
|
122
121
|
};
|
|
123
122
|
|
|
124
|
-
const link = (linkText, url) => {
|
|
125
|
-
if (supportsHyperlinks.stdout) {
|
|
126
|
-
return ['\u001B]8;;', url, '\u0007', linkText, '\u001B]8;;\u0007'].join('');
|
|
127
|
-
} else {
|
|
128
|
-
return `${linkText}: ${url}`;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
123
|
module.exports = {
|
|
133
124
|
getSiteLinks,
|
|
134
125
|
getSiteLinksAsArray,
|
|
135
126
|
logSiteLinks,
|
|
136
127
|
openLink,
|
|
137
|
-
link,
|
|
138
128
|
};
|