Skip to content

Commit 6f3f99c

Browse files
author
Josh Goldberg
authored
Ignore parent NODE_OPTIONS in child_process exec (#1152)
1 parent c2275f3 commit 6f3f99c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/adapters/childProcessExec.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
import { exec } from "child_process";
2-
import { promisify } from "util";
32

43
import { Exec } from "./exec";
54

6-
export const childProcessExec: Exec = promisify(exec);
5+
export const childProcessExec: Exec = async (command: string) => {
6+
return await new Promise((resolve, reject) => {
7+
exec(
8+
command,
9+
{
10+
env: {
11+
NODE_OPTIONS: "",
12+
},
13+
},
14+
(error, stdout, stderr) => {
15+
if (error) {
16+
reject(error);
17+
} else {
18+
resolve({ stderr, stdout });
19+
}
20+
},
21+
);
22+
});
23+
};

0 commit comments

Comments
 (0)