mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 05:37:51 +00:00
Add a --dont-check-device-type option for resin preload
Connects-To: #646 Change-Type: minor
This commit is contained in:
parent
cafde01886
commit
223432406d
@ -151,6 +151,10 @@ module.exports = {
|
||||
signature: 'dont-detect-flasher-type-images',
|
||||
boolean: true,
|
||||
description: 'Disables the flasher type images detection: treats all images as non flasher types'
|
||||
}, {
|
||||
signature: 'dont-check-device-type',
|
||||
boolean: true,
|
||||
description: 'Disables check for matching device types in image and application'
|
||||
}
|
||||
]),
|
||||
action: function(params, options, done) {
|
||||
@ -186,6 +190,9 @@ module.exports = {
|
||||
slug = arg.slug, builds = arg.builds;
|
||||
imageInfoSpinner.stop();
|
||||
return Promise["try"](function() {
|
||||
if (options['dont-check-device-type'] && !options.appId) {
|
||||
expectedError('You need to specify an app id if you disable the device type check.');
|
||||
}
|
||||
if (options.appId) {
|
||||
return preload.getApplication(resin, options.appId)["catch"](errors.ResinApplicationNotFound, expectedError);
|
||||
}
|
||||
|
@ -142,6 +142,11 @@ module.exports =
|
||||
boolean: true
|
||||
description: 'Disables the flasher type images detection: treats all images as non flasher types'
|
||||
}
|
||||
{
|
||||
signature: 'dont-check-device-type'
|
||||
boolean: true
|
||||
description: 'Disables check for matching device types in image and application'
|
||||
}
|
||||
]
|
||||
action: (params, options, done) ->
|
||||
_ = require('lodash')
|
||||
@ -189,6 +194,8 @@ module.exports =
|
||||
imageInfoSpinner.stop()
|
||||
# Use the appId given as --app or show an interactive app selection menu
|
||||
Promise.try ->
|
||||
if options['dont-check-device-type'] and not options.appId
|
||||
expectedError('You need to specify an app id if you disable the device type check.')
|
||||
if options.appId
|
||||
return preload.getApplication(resin, options.appId)
|
||||
.catch(errors.ResinApplicationNotFound, expectedError)
|
||||
|
Loading…
Reference in New Issue
Block a user