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