File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
lib/interface/cli/commands/hybrid Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const { prettyError } = require('../../../../logic/cli-config/errors/helpers');
1919
2020const INSTALLATION_DEFAULTS = {
2121 NAMESPACE : 'codefresh' ,
22- MAKE_DEFAULT_RE : true ,
22+ MAKE_DEFAULT_RE : false ,
2323 RUN_DEMO_PIPELINE : true ,
2424 DEMO_PIPELINE_NAME : 'Codefresh-Runner Demo' ,
2525 CF_CONTEXT_NAME : 'cf-runner' ,
@@ -265,11 +265,23 @@ const initCmd = new Command({
265265 // if this is a new account, don't ask and set this runtime as default
266266 shouldMakeDefaultRe = true ;
267267 } else {
268+ let message = 'Set this as the default runtime environment for your Codefresh account? (Y/N)' ;
269+
270+ const [ listReErr , runtimes ] = await to ( sdk . runtimeEnvs . list ( { } ) ) ;
271+ if ( listReErr ) {
272+ console . debug ( 'Failed to fetch runtimes' ) ;
273+ } else {
274+ const defaultRe = _ . find ( runtimes , re => re . default ) ;
275+ if ( defaultRe ) {
276+ message = `Change the current default runtime ${ defaultRe . metadata . name } to new runtime ?` ;
277+ }
278+ }
279+
268280 questions . push ( {
269281 type : 'confirm' ,
270282 name : 'shouldMakeDefaultRe' ,
271283 default : INSTALLATION_DEFAULTS . MAKE_DEFAULT_RE ,
272- message : 'Set this as the default runtime environment for your Codefresh account? (Y/N)' ,
284+ message,
273285 } ) ;
274286 }
275287 }
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.64.3 " ,
3+ "version" : " 0.64.4 " ,
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