mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Handle Windows permissions elevation automatically
This commit is contained in:
parent
111ea44b40
commit
c3b5a768e1
@ -38,11 +38,10 @@
|
||||
};
|
||||
|
||||
exports.sudo = function(command) {
|
||||
if (os.platform() === 'win32') {
|
||||
return capitano.runAsync(command.join(' '));
|
||||
}
|
||||
command = _.union(_.take(process.argv, 2), command);
|
||||
console.log('Type your computer password to continue');
|
||||
if (os.platform() !== 'win32') {
|
||||
console.log('Type your computer password to continue');
|
||||
}
|
||||
return president.executeAsync(command);
|
||||
};
|
||||
|
||||
|
@ -29,13 +29,9 @@ exports.stateToString = (state) ->
|
||||
throw new Error("Unsupported operation: #{state.operation.type}")
|
||||
|
||||
exports.sudo = (command) ->
|
||||
|
||||
# Bypass privilege elevation for Windows for now.
|
||||
# We should use `windosu` in this case.
|
||||
if os.platform() is 'win32'
|
||||
return capitano.runAsync(command.join(' '))
|
||||
|
||||
command = _.union(_.take(process.argv, 2), command)
|
||||
|
||||
console.log('Type your computer password to continue')
|
||||
if os.platform() isnt 'win32'
|
||||
console.log('Type your computer password to continue')
|
||||
|
||||
return president.executeAsync(command)
|
||||
|
@ -46,7 +46,7 @@
|
||||
"is-root": "^1.0.0",
|
||||
"lodash": "^3.10.0",
|
||||
"nplugm": "^3.0.0",
|
||||
"president": "^2.0.0",
|
||||
"president": "^2.0.1",
|
||||
"prettyjson": "^1.1.3",
|
||||
"resin-cli-errors": "^1.0.0",
|
||||
"resin-cli-events": "^1.0.2",
|
||||
|
Loading…
Reference in New Issue
Block a user