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

Commit

Permalink
Remove usage of printError() in new CLI commands and wrap with callCo…
Browse files Browse the repository at this point in the history
…mmand()
  • Loading branch information
laguirre-cs committed Apr 2, 2024
1 parent c777c4b commit 9e01c19
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions bin/cortex-pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,14 @@ export function create() {
.command('configure')
.option('--refresh', 'Refresh the Github access token')
.description('Configure the Cortex Template system for generating Pipeline templates')
.action((options) => {
try {
return new PipelineTemplateConfigureCommand(pipelines).execute(options);
} catch (err) {
return printError(err.message);
}
});
.action(callCommand((options) => new PipelineTemplateConfigureCommand(pipelines).execute(options)));

// Generate a Pipeline template
pipelines.command('generate [pipelineName] [destination]')
.option('--notree [boolean]', 'Do not dispaly generated file tree', 'false')
.option('--template <templateName>', 'Name of the template to use')
.description('Generates a folder based on a Pipeline template from the template repository')
.action((pipelineName, destination, options) => {
try {
return new PipelineGenerateCommand(pipelines).execute(pipelineName, destination, options);
} catch (err) {
return printError(err.message);
}
});
.action(callCommand((pipelineName, destination, options) => new PipelineGenerateCommand(pipelines).execute(pipelineName, destination, options)));

return pipelines;
}
Expand Down

0 comments on commit 9e01c19

Please sign in to comment.