File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
lib/interface/cli/commands/hybrid Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -114,19 +114,23 @@ const deleteCmd = new Command({
114114 console . log ( colors . yellow ( 'No agents related to the specified kubernetes cluster and namespace were found, displaying all agents' ) ) ;
115115 agentsChoices = agents ;
116116 }
117+ const choicesToAgentNames = agentsChoices . reduce ( ( acc , a ) => {
118+ acc [ `${ a . name } \t${ a . runtimes . length ? `(attached runtimes: ${ a . runtimes . join ( ', ' ) } )` : '' } ` ] = a . name ;
119+ return acc ;
120+ } , { } ) ;
117121 const answer = await inquirer . prompt ( {
118122 type : 'list' ,
119123 name : 'name' ,
120124 message : 'Agent name to uninstall' ,
121- choices : agentsChoices . map ( a => ` ${ a . name } \t ${ a . runtimes . length ? `(attached runtimes: ${ a . runtimes . join ( ', ' ) } )` : '' } ` ) ,
125+ choices : Object . keys ( choicesToAgentNames ) ,
122126 } ) ;
123- agentName = answer . name ;
127+ agentName = choicesToAgentNames [ answer . name ] ;
124128 }
125129
126130 // check that agent exists
127131 const agent = _ . find ( agents , curr => curr . name === agentName ) ;
128132 if ( ! agent ) {
129- console . log ( colors . red ( `Agent with name ${ agentName } doesn't exists` ) ) ;
133+ console . log ( colors . red ( `Agent with name " ${ agentName } " doesn't exists` ) ) ;
130134 return ;
131135 }
132136 if ( agent . runtimes && agent . runtimes . length > 1 ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.64.8 " ,
3+ "version" : " 0.64.9 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments