Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 946cec7

Browse files
juamedgodtrevnorris
authored andcommitted
lib,src: fix spawnSync ignoring its 'env' option
PR-URL: #8546 Reviewed-By: Colin Ihrig <[email protected]>
1 parent 8708c7a commit 946cec7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/child_process.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,7 @@ function spawnSync(/*file, args, options*/) {
12621262

12631263
options.file = opts.file;
12641264
options.args = opts.args;
1265+
options.envPairs = opts.envPairs;
12651266

12661267
if (options.killSignal)
12671268
options.killSignal = lookupSignal(options.killSignal);

src/spawn_sync.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,9 @@ int SyncProcessRunner::ParseOptions(Local<Value> js_value) {
737737
r = CopyJsStringArray(js_env_pairs, &env_buffer_);
738738
if (r < 0)
739739
return r;
740-
uv_process_options_.args = reinterpret_cast<char**>(env_buffer_);
741-
}
742740

741+
uv_process_options_.env = reinterpret_cast<char**>(env_buffer_);
742+
}
743743
Local<Value> js_uid = js_options->Get(env()->uid_string());
744744
if (IsSet(js_uid)) {
745745
if (!CheckRange<uv_uid_t>(js_uid))

0 commit comments

Comments
 (0)