Fix issue with replaced command checks

Change-type: patch
Resolves: #2022
Signed-off-by: Scott Lowe <scott@balena.io>
This commit is contained in:
Scott Lowe 2020-09-08 13:13:53 +02:00
parent bdcf58471f
commit 504877c232

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { stripIndent } from './utils/lazy'; import { stripIndent } from './utils/lazy';
import { ExpectedError } from './errors'; import { exitWithExpectedError } from './errors';
export interface AppOptions { export interface AppOptions {
// Prevent the default behavior of flushing stdout after running a command // Prevent the default behavior of flushing stdout after running a command
@ -101,7 +101,7 @@ export function checkDeletedCommand(argvSlice: string[]): void {
version: string, version: string,
verb = 'replaced', verb = 'replaced',
) { ) {
throw new ExpectedError(stripIndent` exitWithExpectedError(stripIndent`
Note: the command "balena ${oldCmd}" was ${verb} in CLI version ${version}. Note: the command "balena ${oldCmd}" was ${verb} in CLI version ${version}.
Please use "balena ${alternative}" instead. Please use "balena ${alternative}" instead.
`); `);
@ -111,7 +111,7 @@ export function checkDeletedCommand(argvSlice: string[]): void {
if (alternative) { if (alternative) {
msg = [msg, alternative].join('\n'); msg = [msg, alternative].join('\n');
} }
throw new ExpectedError(msg); exitWithExpectedError(msg);
} }
const stopAlternative = const stopAlternative =
'Please use "balena ssh -s" to access the host OS, then use `balena-engine stop`.'; 'Please use "balena ssh -s" to access the host OS, then use `balena-engine stop`.';