Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit 9e01c19

Browse files
committed
Remove usage of printError() in new CLI commands and wrap with callCommand()
1 parent c777c4b commit 9e01c19

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

bin/cortex-pipelines.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,26 +118,14 @@ export function create() {
118118
.command('configure')
119119
.option('--refresh', 'Refresh the Github access token')
120120
.description('Configure the Cortex Template system for generating Pipeline templates')
121-
.action((options) => {
122-
try {
123-
return new PipelineTemplateConfigureCommand(pipelines).execute(options);
124-
} catch (err) {
125-
return printError(err.message);
126-
}
127-
});
121+
.action(callCommand((options) => new PipelineTemplateConfigureCommand(pipelines).execute(options)));
128122

129123
// Generate a Pipeline template
130124
pipelines.command('generate [pipelineName] [destination]')
131125
.option('--notree [boolean]', 'Do not dispaly generated file tree', 'false')
132126
.option('--template <templateName>', 'Name of the template to use')
133127
.description('Generates a folder based on a Pipeline template from the template repository')
134-
.action((pipelineName, destination, options) => {
135-
try {
136-
return new PipelineGenerateCommand(pipelines).execute(pipelineName, destination, options);
137-
} catch (err) {
138-
return printError(err.message);
139-
}
140-
});
128+
.action(callCommand((pipelineName, destination, options) => new PipelineGenerateCommand(pipelines).execute(pipelineName, destination, options)));
141129

142130
return pipelines;
143131
}

0 commit comments

Comments
 (0)