mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
fix(CLI): add check for drive flag with yes flag (#1753)
Add an options check for the `drive` flag to appear with the `yes` flag. If the `yes` flag appears without the `drive` flag then a user error will be thrown. Change-Type: patch Link: https://github.com/resin-io/etcher/pull/1753 Fixes: https://github.com/resin-io/etcher/issues/1454
This commit is contained in:
parent
33db722f68
commit
e815d97265
@ -134,6 +134,18 @@ module.exports = yargs
|
||||
return true
|
||||
})
|
||||
|
||||
// Assert that if the `yes` flag is provided, the `drive` flag is also provided.
|
||||
.check((argv) => {
|
||||
if (argv.yes && !argv.drive) {
|
||||
throw errors.createUserError({
|
||||
title: 'Missing drive',
|
||||
description: 'You need to explicitly pass a drive when disabling interactively'
|
||||
})
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
|
||||
.options({
|
||||
help: {
|
||||
describe: 'show help',
|
||||
|
Loading…
x
Reference in New Issue
Block a user