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({
114
114
console . log ( colors . yellow ( 'No agents related to the specified kubernetes cluster and namespace were found, displaying all agents' ) ) ;
115
115
agentsChoices = agents ;
116
116
}
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
+ } , { } ) ;
117
121
const answer = await inquirer . prompt ( {
118
122
type : 'list' ,
119
123
name : 'name' ,
120
124
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 ) ,
122
126
} ) ;
123
- agentName = answer . name ;
127
+ agentName = choicesToAgentNames [ answer . name ] ;
124
128
}
125
129
126
130
// check that agent exists
127
131
const agent = _ . find ( agents , curr => curr . name === agentName ) ;
128
132
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` ) ) ;
130
134
return ;
131
135
}
132
136
if ( agent . runtimes && agent . runtimes . length > 1 ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.64.8 " ,
3
+ "version" : " 0.64.9 " ,
4
4
"description" : " Codefresh command line utility" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments