mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 19:56:37 +00:00
Merge pull request #2829 from balena-io/dont-elevate-when-root
Don't use sudo-prompt when already elevated
This commit is contained in:
commit
a58e060138
@ -179,6 +179,10 @@ const elevateScriptUnix = async (path, name) => {
|
|||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
exports.elevateCommand = async (command, options) => {
|
exports.elevateCommand = async (command, options) => {
|
||||||
|
if (await exports.isElevated()) {
|
||||||
|
await childProcess.execFileAsync(command[0], command.slice(1), { env: options.environment })
|
||||||
|
return { cancelled: false }
|
||||||
|
}
|
||||||
const isWindows = os.platform() === 'win32'
|
const isWindows = os.platform() === 'win32'
|
||||||
const launchScript = exports.createLaunchScript(command[0], command.slice(1), options.environment)
|
const launchScript = exports.createLaunchScript(command[0], command.slice(1), options.environment)
|
||||||
return Bluebird.using(tmpFileDisposer({ postfix: '.cmd' }), async ({ path }) => {
|
return Bluebird.using(tmpFileDisposer({ postfix: '.cmd' }), async ({ path }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user