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:
parent
d3cb072cff
commit
4a5baf5716
1 changed files with 2 additions and 0 deletions
2
index.js
2
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,
|
||||
|
|
Loading…
Reference in a new issue