@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/open.js
CHANGED
|
@@ -6,17 +6,20 @@ const {
|
|
|
6
6
|
} = require('../lib/commonOpts');
|
|
7
7
|
const { trackCommandUsage } = require('../lib/usageTracking');
|
|
8
8
|
const { logSiteLinks, getSiteLinksAsArray, openLink } = require('../lib/links');
|
|
9
|
-
const
|
|
9
|
+
const { promptUser } = require('../lib/prompts/promptUtils');
|
|
10
|
+
const { i18n } = require('@hubspot/cli-lib/lib/lang');
|
|
11
|
+
|
|
12
|
+
const i18nKey = 'cli.commands.open';
|
|
10
13
|
|
|
11
14
|
const separator = ' => ';
|
|
12
15
|
const createListPrompt = async accountId =>
|
|
13
|
-
|
|
16
|
+
promptUser([
|
|
14
17
|
{
|
|
15
18
|
type: 'rawlist',
|
|
16
19
|
look: false,
|
|
17
20
|
name: 'open',
|
|
18
21
|
pageSize: 20,
|
|
19
|
-
message:
|
|
22
|
+
message: i18n(`${i18nKey}.selectLink`),
|
|
20
23
|
choices: getSiteLinksAsArray(accountId).map(
|
|
21
24
|
l => `${l.shortcut}${separator}${l.url}`
|
|
22
25
|
),
|
|
@@ -25,8 +28,7 @@ const createListPrompt = async accountId =>
|
|
|
25
28
|
]);
|
|
26
29
|
|
|
27
30
|
exports.command = 'open [shortcut]';
|
|
28
|
-
exports.describe =
|
|
29
|
-
'Open a HubSpot page in your browser. Run ‘hs open list’ to see all available shortcuts.';
|
|
31
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
30
32
|
|
|
31
33
|
exports.handler = async options => {
|
|
32
34
|
const { shortcut, list } = options;
|
|
@@ -47,13 +49,13 @@ exports.handler = async options => {
|
|
|
47
49
|
|
|
48
50
|
exports.builder = yargs => {
|
|
49
51
|
yargs.positional('[shortcut]', {
|
|
50
|
-
describe:
|
|
52
|
+
describe: i18n(`${i18nKey}.positionals.shortcut.describe`),
|
|
51
53
|
type: 'string',
|
|
52
54
|
});
|
|
53
55
|
|
|
54
56
|
yargs.option('list', {
|
|
55
57
|
alias: 'l',
|
|
56
|
-
describe:
|
|
58
|
+
describe: i18n(`${i18nKey}.options.list.describe`),
|
|
57
59
|
type: 'boolean',
|
|
58
60
|
});
|
|
59
61
|
|
|
@@ -1,73 +1,57 @@
|
|
|
1
1
|
const {
|
|
2
2
|
addAccountOptions,
|
|
3
3
|
addConfigOptions,
|
|
4
|
-
setLogLevel,
|
|
5
4
|
getAccountId,
|
|
6
5
|
addUseEnvironmentOptions,
|
|
7
6
|
} = require('../../lib/commonOpts');
|
|
8
7
|
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
9
|
-
const {
|
|
10
|
-
const {
|
|
11
|
-
loadConfig,
|
|
12
|
-
validateConfig,
|
|
13
|
-
checkAndWarnGitInclusion,
|
|
14
|
-
} = require('@hubspot/cli-lib');
|
|
15
|
-
const { validateAccount } = require('../../lib/validation');
|
|
8
|
+
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
16
9
|
const { getCwd } = require('@hubspot/cli-lib/path');
|
|
17
10
|
const path = require('path');
|
|
18
11
|
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = require('../../lib/projects');
|
|
22
|
-
|
|
23
|
-
const loadAndValidateOptions = async options => {
|
|
24
|
-
setLogLevel(options);
|
|
25
|
-
logDebugInfo(options);
|
|
26
|
-
const { config: configPath } = options;
|
|
27
|
-
loadConfig(configPath, options);
|
|
28
|
-
checkAndWarnGitInclusion();
|
|
12
|
+
createProjectPrompt,
|
|
13
|
+
} = require('../../lib/prompts/createProjectPrompt');
|
|
14
|
+
const { createProjectConfig } = require('../../lib/projects');
|
|
15
|
+
const { i18n } = require('@hubspot/cli-lib/lib/lang');
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
17
|
+
const i18nKey = 'cli.commands.project.subcommands.create';
|
|
34
18
|
|
|
35
|
-
exports.command = 'create
|
|
36
|
-
exports.describe =
|
|
19
|
+
exports.command = 'create';
|
|
20
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
37
21
|
|
|
38
22
|
exports.handler = async options => {
|
|
39
|
-
loadAndValidateOptions(options);
|
|
23
|
+
await loadAndValidateOptions(options);
|
|
40
24
|
|
|
41
|
-
const { path: projectPath, name } = options;
|
|
42
25
|
const accountId = getAccountId(options);
|
|
43
26
|
|
|
44
|
-
|
|
27
|
+
const { name, template, location } = await createProjectPrompt(options);
|
|
45
28
|
|
|
46
|
-
|
|
29
|
+
trackCommandUsage('project-create', { projectName: name }, accountId);
|
|
47
30
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
await createProjectConfig(
|
|
32
|
+
path.resolve(getCwd(), options.location || location),
|
|
33
|
+
options.name || name,
|
|
34
|
+
options.template || template
|
|
35
|
+
);
|
|
51
36
|
};
|
|
52
37
|
|
|
53
38
|
exports.builder = yargs => {
|
|
54
|
-
yargs.positional('path', {
|
|
55
|
-
describe: 'Path to a project folder',
|
|
56
|
-
type: 'string',
|
|
57
|
-
});
|
|
58
39
|
yargs.options({
|
|
59
40
|
name: {
|
|
60
|
-
describe:
|
|
41
|
+
describe: i18n(`${i18nKey}.options.name.describe`),
|
|
42
|
+
type: 'string',
|
|
43
|
+
},
|
|
44
|
+
location: {
|
|
45
|
+
describe: i18n(`${i18nKey}.options.location.describe`),
|
|
46
|
+
type: 'string',
|
|
47
|
+
},
|
|
48
|
+
template: {
|
|
49
|
+
describe: i18n(`${i18nKey}.options.template.describe`),
|
|
61
50
|
type: 'string',
|
|
62
51
|
},
|
|
63
52
|
});
|
|
64
53
|
|
|
65
|
-
yargs.example([
|
|
66
|
-
[
|
|
67
|
-
'$0 project create myProjectFolder',
|
|
68
|
-
'Create a project within the myProjectFolder folder',
|
|
69
|
-
],
|
|
70
|
-
]);
|
|
54
|
+
yargs.example([['$0 project create', i18n(`${i18nKey}.examples.default`)]]);
|
|
71
55
|
|
|
72
56
|
addConfigOptions(yargs, true);
|
|
73
57
|
addAccountOptions(yargs, true);
|
|
@@ -1,62 +1,57 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
1
|
const {
|
|
3
2
|
addAccountOptions,
|
|
4
3
|
addConfigOptions,
|
|
5
|
-
setLogLevel,
|
|
6
4
|
getAccountId,
|
|
7
5
|
addUseEnvironmentOptions,
|
|
8
6
|
} = require('../../lib/commonOpts');
|
|
9
7
|
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
10
|
-
const { logDebugInfo } = require('../../lib/debugInfo');
|
|
11
|
-
const {
|
|
12
|
-
loadConfig,
|
|
13
|
-
validateConfig,
|
|
14
|
-
checkAndWarnGitInclusion,
|
|
15
|
-
} = require('@hubspot/cli-lib');
|
|
16
8
|
const {
|
|
17
9
|
logApiErrorInstance,
|
|
18
10
|
ApiErrorContext,
|
|
19
11
|
} = require('@hubspot/cli-lib/errorHandlers');
|
|
20
12
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
21
13
|
const { deployProject, fetchProject } = require('@hubspot/cli-lib/api/dfs');
|
|
22
|
-
const {
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (!(validateConfig() && (await validateAccount(options)))) {
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
14
|
+
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
15
|
+
const {
|
|
16
|
+
getProjectConfig,
|
|
17
|
+
pollDeployStatus,
|
|
18
|
+
validateProjectConfig,
|
|
19
|
+
} = require('../../lib/projects');
|
|
20
|
+
const { i18n } = require('@hubspot/cli-lib/lib/lang');
|
|
21
|
+
|
|
22
|
+
const i18nKey = 'cli.commands.project.subcommands.deploy';
|
|
23
|
+
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
37
24
|
|
|
38
25
|
exports.command = 'deploy [path]';
|
|
39
|
-
exports.describe =
|
|
26
|
+
exports.describe = i18n(`${i18nKey}.describe`);
|
|
40
27
|
|
|
41
28
|
exports.handler = async options => {
|
|
42
|
-
loadAndValidateOptions(options);
|
|
29
|
+
await loadAndValidateOptions(options);
|
|
43
30
|
|
|
44
31
|
const { path: projectPath, buildId } = options;
|
|
45
32
|
const accountId = getAccountId(options);
|
|
46
33
|
|
|
47
34
|
trackCommandUsage('project-deploy', { projectPath }, accountId);
|
|
48
35
|
|
|
49
|
-
const
|
|
50
|
-
|
|
36
|
+
const { projectConfig, projectDir } = await getProjectConfig(projectPath);
|
|
37
|
+
|
|
38
|
+
validateProjectConfig(projectConfig, projectDir);
|
|
39
|
+
|
|
40
|
+
logger.debug(
|
|
41
|
+
i18n(`${i18nKey}.debug.deploying`, {
|
|
42
|
+
path: projectPath,
|
|
43
|
+
})
|
|
44
|
+
);
|
|
51
45
|
|
|
52
|
-
|
|
46
|
+
let exitCode = EXIT_CODES.SUCCESS;
|
|
53
47
|
|
|
54
48
|
const getBuildId = async () => {
|
|
55
49
|
const { latestBuild } = await fetchProject(accountId, projectConfig.name);
|
|
56
50
|
if (latestBuild && latestBuild.buildId) {
|
|
57
51
|
return latestBuild.buildId;
|
|
58
52
|
}
|
|
59
|
-
logger.error(
|
|
53
|
+
logger.error(i18n(`${i18nKey}.errors.noBuildId`));
|
|
54
|
+
exitCode = EXIT_CODES.ERROR;
|
|
60
55
|
return;
|
|
61
56
|
};
|
|
62
57
|
|
|
@@ -70,7 +65,12 @@ exports.handler = async options => {
|
|
|
70
65
|
);
|
|
71
66
|
|
|
72
67
|
if (deployResp.error) {
|
|
73
|
-
logger.error(
|
|
68
|
+
logger.error(
|
|
69
|
+
i18n(`${i18nKey}.errors.deploy`, {
|
|
70
|
+
details: deployResp.error.message,
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
exitCode = EXIT_CODES.ERROR;
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -86,27 +86,26 @@ exports.handler = async options => {
|
|
|
86
86
|
} else {
|
|
87
87
|
logApiErrorInstance(e, new ApiErrorContext({ accountId, projectPath }));
|
|
88
88
|
}
|
|
89
|
+
exitCode = 1;
|
|
89
90
|
}
|
|
91
|
+
process.exit(exitCode);
|
|
90
92
|
};
|
|
91
93
|
|
|
92
94
|
exports.builder = yargs => {
|
|
93
95
|
yargs.positional('path', {
|
|
94
|
-
describe:
|
|
96
|
+
describe: i18n(`${i18nKey}.positionals.path.describe`),
|
|
95
97
|
type: 'string',
|
|
96
98
|
});
|
|
97
99
|
|
|
98
100
|
yargs.options({
|
|
99
101
|
buildId: {
|
|
100
|
-
describe:
|
|
102
|
+
describe: i18n(`${i18nKey}.options.buildId.describe`),
|
|
101
103
|
type: 'number',
|
|
102
104
|
},
|
|
103
105
|
});
|
|
104
106
|
|
|
105
107
|
yargs.example([
|
|
106
|
-
[
|
|
107
|
-
'$0 project deploy myProjectFolder',
|
|
108
|
-
'Deploy a project within the myProjectFolder folder',
|
|
109
|
-
],
|
|
108
|
+
['$0 project deploy myProjectFolder', i18n(`${i18nKey}.examples.default`)],
|
|
110
109
|
]);
|
|
111
110
|
|
|
112
111
|
addConfigOptions(yargs, true);
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
addAccountOptions,
|
|
5
|
+
addConfigOptions,
|
|
6
|
+
getAccountId,
|
|
7
|
+
addUseEnvironmentOptions,
|
|
8
|
+
} = require('../../lib/commonOpts');
|
|
9
|
+
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
10
|
+
const {
|
|
11
|
+
logApiErrorInstance,
|
|
12
|
+
ApiErrorContext,
|
|
13
|
+
} = require('@hubspot/cli-lib/errorHandlers');
|
|
14
|
+
const { logger } = require('@hubspot/cli-lib/logger');
|
|
15
|
+
const {
|
|
16
|
+
fetchProject,
|
|
17
|
+
fetchProjectBuilds,
|
|
18
|
+
} = require('@hubspot/cli-lib/api/dfs');
|
|
19
|
+
const {
|
|
20
|
+
getTableContents,
|
|
21
|
+
getTableHeader,
|
|
22
|
+
} = require('@hubspot/cli-lib/lib/table');
|
|
23
|
+
const { getCwd } = require('@hubspot/cli-lib/path');
|
|
24
|
+
const { uiLink } = require('../../lib/ui');
|
|
25
|
+
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
26
|
+
const {
|
|
27
|
+
getProjectConfig,
|
|
28
|
+
getProjectDetailUrl,
|
|
29
|
+
validateProjectConfig,
|
|
30
|
+
} = require('../../lib/projects');
|
|
31
|
+
const moment = require('moment');
|
|
32
|
+
const { promptUser } = require('../../lib/prompts/promptUtils');
|
|
33
|
+
|
|
34
|
+
exports.command = 'list-builds [path]';
|
|
35
|
+
exports.describe = false;
|
|
36
|
+
|
|
37
|
+
exports.handler = async options => {
|
|
38
|
+
await loadAndValidateOptions(options);
|
|
39
|
+
|
|
40
|
+
const { path: projectPath, limit } = options;
|
|
41
|
+
const accountId = getAccountId(options);
|
|
42
|
+
|
|
43
|
+
trackCommandUsage('project-list-builds', { projectPath }, accountId);
|
|
44
|
+
|
|
45
|
+
const cwd = projectPath ? path.resolve(getCwd(), projectPath) : getCwd();
|
|
46
|
+
const { projectConfig, projectDir } = await getProjectConfig(cwd);
|
|
47
|
+
|
|
48
|
+
validateProjectConfig(projectConfig, projectDir);
|
|
49
|
+
|
|
50
|
+
logger.debug(`Fetching builds for project at path: ${projectPath}`);
|
|
51
|
+
|
|
52
|
+
const fetchAndDisplayBuilds = async (project, options) => {
|
|
53
|
+
const { results, paging } = await fetchProjectBuilds(
|
|
54
|
+
accountId,
|
|
55
|
+
project.name,
|
|
56
|
+
options
|
|
57
|
+
);
|
|
58
|
+
const currentDeploy = project.deployedBuildId;
|
|
59
|
+
if (options && options.after) {
|
|
60
|
+
logger.log(
|
|
61
|
+
`Showing the next ${results.length} builds for ${project.name}`
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
logger.log(
|
|
65
|
+
`Showing the ${results.length} most recent builds for ${project.name}. ` +
|
|
66
|
+
uiLink(
|
|
67
|
+
'View all builds in project details.',
|
|
68
|
+
getProjectDetailUrl(project.name, accountId)
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (results.length === 0) {
|
|
74
|
+
logger.log('No builds found.');
|
|
75
|
+
} else {
|
|
76
|
+
const builds = results.map(build => {
|
|
77
|
+
const isCurrentlyDeployed = build.buildId === currentDeploy;
|
|
78
|
+
|
|
79
|
+
return [
|
|
80
|
+
isCurrentlyDeployed
|
|
81
|
+
? `#${build.buildId} [deployed]`
|
|
82
|
+
: `#${build.buildId}`,
|
|
83
|
+
build.status,
|
|
84
|
+
moment(build.finishedAt).format('MM/DD/YY, hh:mm:ssa'),
|
|
85
|
+
Math.round(
|
|
86
|
+
moment
|
|
87
|
+
.duration(moment(build.finishedAt).diff(moment(build.enqueuedAt)))
|
|
88
|
+
.asSeconds()
|
|
89
|
+
) + 's',
|
|
90
|
+
build.subbuildStatuses
|
|
91
|
+
.filter(subbuild => subbuild.status === 'FAILURE')
|
|
92
|
+
.map(subbuild => `${subbuild.buildName} failed`)
|
|
93
|
+
.join(', '),
|
|
94
|
+
];
|
|
95
|
+
});
|
|
96
|
+
builds.unshift(
|
|
97
|
+
getTableHeader([
|
|
98
|
+
'Build ID',
|
|
99
|
+
'Status',
|
|
100
|
+
'Completed',
|
|
101
|
+
'Duration',
|
|
102
|
+
'Details',
|
|
103
|
+
])
|
|
104
|
+
);
|
|
105
|
+
logger.log(
|
|
106
|
+
getTableContents(builds, {
|
|
107
|
+
columnDefault: {
|
|
108
|
+
paddingLeft: 3,
|
|
109
|
+
},
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
if (paging && paging.next) {
|
|
114
|
+
await promptUser({
|
|
115
|
+
name: 'more',
|
|
116
|
+
message: 'Press <enter> to load more, or ctrl+c to exit',
|
|
117
|
+
});
|
|
118
|
+
await fetchAndDisplayBuilds(project, { limit, after: paging.next.after });
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
const project = await fetchProject(accountId, projectConfig.name);
|
|
124
|
+
|
|
125
|
+
await fetchAndDisplayBuilds(project, { limit });
|
|
126
|
+
} catch (e) {
|
|
127
|
+
if (e.statusCode === 404) {
|
|
128
|
+
logger.error(`Project ${projectConfig.name} not found. `);
|
|
129
|
+
} else {
|
|
130
|
+
logApiErrorInstance(e, new ApiErrorContext({ accountId }));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
exports.builder = yargs => {
|
|
136
|
+
yargs.positional('path', {
|
|
137
|
+
describe: 'Path to a project folder',
|
|
138
|
+
type: 'string',
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
yargs.options({
|
|
142
|
+
limit: {
|
|
143
|
+
describe: 'Max number of builds to load',
|
|
144
|
+
type: 'string',
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
yargs.example([
|
|
149
|
+
[
|
|
150
|
+
'$0 project list-builds myProjectFolder',
|
|
151
|
+
'Fetch a list of builds for a project within the myProjectFolder folder',
|
|
152
|
+
],
|
|
153
|
+
]);
|
|
154
|
+
|
|
155
|
+
addConfigOptions(yargs, true);
|
|
156
|
+
addAccountOptions(yargs, true);
|
|
157
|
+
addUseEnvironmentOptions(yargs, true);
|
|
158
|
+
|
|
159
|
+
return yargs;
|
|
160
|
+
};
|