v12 preparations: Add version switch, update login message.

Change-type: patch
Connects-to: #1770
Signed-off-by: Scott Lowe <scott@balena.io>
This commit is contained in:
Scott Lowe
2020-05-27 13:05:49 +02:00
parent 56a196210d
commit 889c7b08cf
2 changed files with 16 additions and 2 deletions

View File

@ -25,6 +25,9 @@ import * as ShellEscape from 'shell-escape';
import { ExpectedError } from '../errors';
import { getBalenaSdk, getChalk, getVisuals } from './lazy';
import * as semver from 'semver';
import { version } from '../../package.json';
export function getGroupDefaults(group: {
options: Array<{ name: string; default?: string }>;
}): { [name: string]: string | number | undefined } {
@ -465,3 +468,7 @@ export function getProxyConfig(): ProxyConfig | undefined {
}
}
}
export function isVersionGTE(v: string) {
return semver.gte(process.env.BALENA_CLI_VERSION_OVERRIDE || version, v);
}