mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
Allow advanced option in device init
This option is inherited to `os configure`.
This commit is contained in:
parent
ff81c1e514
commit
f2507daa09
@ -143,7 +143,14 @@
|
||||
signature: 'device init',
|
||||
description: 'initialise a device with resin os',
|
||||
help: 'Use this command to download the OS image of a certain application and write it to an SD Card.\n\nNotice this command may ask for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n\n $ resin device init\n $ resin device init --application MyApp',
|
||||
options: [commandOptions.optionalApplication, commandOptions.yes],
|
||||
options: [
|
||||
commandOptions.optionalApplication, commandOptions.yes, {
|
||||
signature: 'advanced',
|
||||
description: 'enable advanced configuration',
|
||||
boolean: true,
|
||||
alias: 'v'
|
||||
}
|
||||
],
|
||||
permission: 'user',
|
||||
primary: true,
|
||||
action: function(params, options, done) {
|
||||
@ -163,7 +170,12 @@
|
||||
};
|
||||
return Promise.using(download(), function(temporalPath) {
|
||||
return capitano.runAsync("device register " + application.app_name).then(resin.models.device.get).tap(function(device) {
|
||||
return capitano.runAsync("os configure " + temporalPath + " " + device.uuid).then(function() {
|
||||
var configure;
|
||||
configure = "os configure " + temporalPath + " " + device.uuid;
|
||||
if (options.advanced) {
|
||||
configure += ' --advanced';
|
||||
}
|
||||
return capitano.runAsync(configure).then(function() {
|
||||
return helpers.sudo(['os', 'initialize', temporalPath, '--type', application.device_type]);
|
||||
});
|
||||
});
|
||||
|
@ -317,6 +317,10 @@ application name
|
||||
|
||||
confirm non interactively
|
||||
|
||||
#### --advanced, -v
|
||||
|
||||
enable advanced configuration
|
||||
|
||||
# Environment Variables
|
||||
|
||||
## envs
|
||||
|
@ -198,6 +198,12 @@ exports.init =
|
||||
options: [
|
||||
commandOptions.optionalApplication
|
||||
commandOptions.yes
|
||||
{
|
||||
signature: 'advanced'
|
||||
description: 'enable advanced configuration'
|
||||
boolean: true
|
||||
alias: 'v'
|
||||
}
|
||||
]
|
||||
permission: 'user'
|
||||
primary: true
|
||||
@ -218,7 +224,10 @@ exports.init =
|
||||
capitano.runAsync("device register #{application.app_name}")
|
||||
.then(resin.models.device.get)
|
||||
.tap (device) ->
|
||||
capitano.runAsync("os configure #{temporalPath} #{device.uuid}").then ->
|
||||
configure = "os configure #{temporalPath} #{device.uuid}"
|
||||
configure += ' --advanced' if options.advanced
|
||||
capitano.runAsync(configure).then ->
|
||||
|
||||
helpers.sudo([ 'os', 'initialize', temporalPath, '--type', application.device_type ])
|
||||
.then (device) ->
|
||||
console.log('Done')
|
||||
|
Loading…
Reference in New Issue
Block a user