Fix sudo-prompt promisification

Changelog-entry: Fix sudo-prompt promisification
Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-06-03 20:00:46 +02:00
parent f0bbd1a1cd
commit b7e82f7694

View File

@ -29,7 +29,10 @@ import { tmpFileDisposer } from './utils';
const execAsync = promisify(childProcess.exec);
const execFileAsync = promisify(childProcess.execFile);
const sudoExecAsync = promisify(sudoPrompt.exec);
// sudo-prompt's exec callback is function(error, stdout, stderr) so we need multiArgs
const sudoExecAsync = Bluebird.promisify(sudoPrompt.exec, {
multiArgs: true,
}) as (cmd: string, options: any) => Bluebird<[string, string]>;
/**
* @summary The user id of the UNIX "superuser"