From 4a5baf5716d05a50694a03b4f5b7f7e71abdf245 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Sun, 15 May 2016 23:40:28 -0400 Subject: [PATCH] Preserve user environment Some child processes executed with this module might benefit from being able to read their parent process environment variables. Fixes: https://github.com/jorangreef/sudo-prompt/issues/20 Signed-off-by: Juan Cruz Viotti --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 774245d..57e934f 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,8 @@ function Attempt(instance, end) { var command = []; command.push('/usr/bin/sudo'); command.push('-n'); + // Preserve user environment: + command.push('-E'); command.push(instance.command); command = command.join(' '); Node.child.exec(command,