diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-08-01 04:51:41 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-08-01 04:51:43 +0400 |
commit | 624dd38d898d9a69a60320010d8598823ab1f603 (patch) | |
tree | b2e2724f0e1e9fd02a03ae02fc2d410d53e3ef35 /lib | |
parent | ef767a152b1033c1dc67631b8cc377fb3acb933d (diff) |
child_process_uv: fix test/simple/test-child-process-env
Diffstat (limited to 'lib')
-rw-r--r-- | lib/child_process_uv.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/child_process_uv.js b/lib/child_process_uv.js index 6352c93828e..5902ac31bbd 100644 --- a/lib/child_process_uv.js +++ b/lib/child_process_uv.js @@ -172,10 +172,18 @@ var spawn = exports.spawn = function(file, args, options) { var args = args ? args.slice(0) : []; args.unshift(file); + var env = (options ? options.env : null) || process.env; + var envPairs = []; + var keys = Object.keys(env); + for (var key in env) { + envPairs.push(key + '=' + env[key]); + } + child.spawn({ file: file, args: args, - cwd: options ? options.cwd : null + cwd: options ? options.cwd : null, + envPairs: envPairs }); return child; |