Exit with a warning if "env rm" id value is not an integer

Change-type: patch
Signed-off-by: Lucian <lucian.buzzo@gmail.com>
This commit is contained in:
Lucian 2019-08-07 09:35:37 +01:00
parent 2390ddc02d
commit 34f4c1f6cc

View File

@ -136,6 +136,10 @@ export const remove: CommandDefinition<
const balena = (await import('balena-sdk')).fromSharedOptions();
const patterns = await import('../utils/patterns');
if (typeof params.id !== 'number') {
patterns.exitWithExpectedError('The environment variable id must be an integer');
}
return patterns
.confirm(
options.yes || false,