mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-29 23:54:12 +00:00
Explain why we need the computer password on device init
This commit is contained in:
parent
0f8d6a98e3
commit
abc8399260
@ -195,7 +195,9 @@
|
||||
configure += ' --advanced';
|
||||
}
|
||||
return capitano.runAsync(configure).then(function() {
|
||||
return helpers.sudo(['os', 'initialize', temporalPath, '--type', application.device_type]);
|
||||
var message;
|
||||
message = 'Initializing a device requires administration permissions\ngiven that we need to access raw devices directly.\n';
|
||||
return helpers.sudo(['os', 'initialize', temporalPath, '--type', application.device_type], message);
|
||||
});
|
||||
});
|
||||
}).then(function(device) {
|
||||
|
@ -37,8 +37,9 @@
|
||||
}
|
||||
};
|
||||
|
||||
exports.sudo = function(command) {
|
||||
exports.sudo = function(command, message) {
|
||||
command = _.union(_.take(process.argv, 2), command);
|
||||
console.log(message);
|
||||
if (os.platform() !== 'win32') {
|
||||
console.log('Type your computer password to continue');
|
||||
}
|
||||
|
@ -253,8 +253,13 @@ exports.init =
|
||||
configure = "os configure #{temporalPath} #{device.uuid}"
|
||||
configure += ' --advanced' if options.advanced
|
||||
capitano.runAsync(configure).then ->
|
||||
message = '''
|
||||
Initializing a device requires administration permissions
|
||||
given that we need to access raw devices directly.
|
||||
|
||||
helpers.sudo([ 'os', 'initialize', temporalPath, '--type', application.device_type ])
|
||||
'''
|
||||
|
||||
helpers.sudo([ 'os', 'initialize', temporalPath, '--type', application.device_type ], message)
|
||||
.then (device) ->
|
||||
console.log('Done')
|
||||
return device.uuid
|
||||
|
@ -28,8 +28,9 @@ exports.stateToString = (state) ->
|
||||
else
|
||||
throw new Error("Unsupported operation: #{state.operation.type}")
|
||||
|
||||
exports.sudo = (command) ->
|
||||
exports.sudo = (command, message) ->
|
||||
command = _.union(_.take(process.argv, 2), command)
|
||||
console.log(message)
|
||||
|
||||
if os.platform() isnt 'win32'
|
||||
console.log('Type your computer password to continue')
|
||||
|
Loading…
x
Reference in New Issue
Block a user