mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
4647aa70c0
- Add helpers.confirm() to abstract the process of asking for confirmation. - Add helpers.selectDeviceType() to abstract the form needed to ask for device types. The functions on this module are reused by app actions.
24 lines
470 B
CoffeeScript
24 lines
470 B
CoffeeScript
Promise = require('bluebird')
|
|
form = require('resin-cli-form')
|
|
|
|
exports.selectDeviceType = ->
|
|
return form.ask
|
|
message: 'Device Type'
|
|
type: 'list'
|
|
choices: [
|
|
|
|
# Lock to specific devices until we support
|
|
# the rest with device specs.
|
|
'Raspberry Pi'
|
|
'Raspberry Pi 2'
|
|
'BeagleBone Black'
|
|
]
|
|
|
|
exports.confirm = (yesOption, message) ->
|
|
Promise.try ->
|
|
return true if yesOption
|
|
return form.ask
|
|
message: message
|
|
type: 'confirm'
|
|
default: false
|