Explain why we need the computer password on device init

This commit is contained in:
Juan Cruz Viotti 2015-12-02 11:15:20 -04:00
parent 0f8d6a98e3
commit abc8399260
4 changed files with 13 additions and 4 deletions

View File

@ -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) {

View File

@ -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');
}

View File

@ -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

View File

@ -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')