Skip to content

Commit 553f5f9

Browse files
ask about default re (#476)
1 parent 4116f06 commit 553f5f9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/interface/cli/commands/hybrid/init.cmd.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const { prettyError } = require('../../../../logic/cli-config/errors/helpers');
1919

2020
const 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
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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,

0 commit comments

Comments
 (0)