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 <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-05-15 23:40:28 -04:00
parent d3cb072cff
commit 4a5baf5716

View file

@ -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,