From b7e82f7694989dd525eacb98b4589048d846848b Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Wed, 3 Jun 2020 20:00:46 +0200 Subject: [PATCH] Fix sudo-prompt promisification Changelog-entry: Fix sudo-prompt promisification Change-type: patch --- lib/shared/permissions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/shared/permissions.ts b/lib/shared/permissions.ts index a3c93665..0390e034 100755 --- a/lib/shared/permissions.ts +++ b/lib/shared/permissions.ts @@ -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"