Skip to content

Commit

Permalink
child_process, feat: support inherit mode in execFile.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Apr 11, 2023
1 parent d3b5406 commit 97309cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion fibjs/src/process/child_process.cpp
Expand Up @@ -148,7 +148,6 @@ result_t child_process_base::execFile(exlib::string command, v8::Local<v8::Array
util_base::clone(options, opts_);

opts = v8::Local<v8::Object>::Cast(opts_);
opts->Delete(opts->GetCreationContextChecked(), isolate->NewString("stdio")).IsJust();

exlib::string codec("utf8");
GetConfigValue(isolate->m_isolate, opts, "encoding", codec);
Expand Down
10 changes: 10 additions & 0 deletions test/child_process_test.js
Expand Up @@ -424,6 +424,16 @@ describe("child_process", () => {
]);
});

it("inherit in execFile", () => {
assert.isUndefined(child_process.execFile(cmd, [
path.join(__dirname, "process", "exec2.js"),
"参数1",
"参数2"
], {
stdio: "inherit"
}).stdout);
});

it("execArgv", () => {
assert.deepEqual(json.decode(child_process.execFile(cmd, [
"--use_strict",
Expand Down

0 comments on commit 97309cb

Please sign in to comment.