From 67205f5032bc8b54182b18fc80be960849cf21cc Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 7 Jul 2021 07:46:27 -0400 Subject: [PATCH] Revert "Ignore parent NODE_OPTIONS in child_process exec (#1152)" This reverts commit 6f3f99cae0056f5190db4d32310c1cd7d5a47972. --- src/adapters/childProcessExec.ts | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/adapters/childProcessExec.ts b/src/adapters/childProcessExec.ts index a74cb6c1c..061e97266 100644 --- a/src/adapters/childProcessExec.ts +++ b/src/adapters/childProcessExec.ts @@ -1,23 +1,6 @@ import { exec } from "child_process"; +import { promisify } from "util"; import { Exec } from "./exec"; -export const childProcessExec: Exec = async (command: string) => { - return await new Promise((resolve, reject) => { - exec( - command, - { - env: { - NODE_OPTIONS: "", - }, - }, - (error, stdout, stderr) => { - if (error) { - reject(error); - } else { - resolve({ stderr, stdout }); - } - }, - ); - }); -}; +export const childProcessExec: Exec = promisify(exec);