Skip to content

Commit

Permalink
fix(help): build commands optinal params check if need one of them
Browse files Browse the repository at this point in the history
  • Loading branch information
Alnyli07 committed Jan 29, 2024
1 parent 26a9a26 commit b67518e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/command-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ export const runCommand = async (command: ProgramCommand) => {
break;
}
case CommandTypes.BUILD: {
//Check optional params if need one of them
if(!params.branchId && !params.branch){
console.error("error: You must provide either branchId or branch parameter");
process.exit(1);
}
if(!params.workflowId && !params.workflow){
console.error("error: You must provide either workflowId or workflow parameter");
process.exit(1);
}
const spinner = createOra(`Try to start a new build`).start();
try {
responseData = await startBuild(params);
Expand Down Expand Up @@ -277,8 +286,7 @@ export const runCommand = async (command: ProgramCommand) => {
handleConfigCommand(command);
break;
default: {
console.log('Coomd: ', command.name(), command.args())
console.error("Command not found");
console.error("Command not found: ", commandName );
process.exit(1);
}
}
Expand Down

0 comments on commit b67518e

Please sign in to comment.