From 1a9ced0bb8021369c25c3de238abbd8c601e249c Mon Sep 17 00:00:00 2001 From: Ruakij Date: Thu, 25 Nov 2021 18:32:07 +0100 Subject: [PATCH] Changed exec to only wrap spawn --- src/helper/exec.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/helper/exec.js b/src/helper/exec.js index 63f6c69..5523f5c 100644 --- a/src/helper/exec.js +++ b/src/helper/exec.js @@ -3,18 +3,11 @@ const logger = require("./logger.js")("exec"); const { spawn } = require("child_process"); -function exec(cmd, stdout, stderr, exit_handler){ - const [bin, ...args] = cmd.split(' ') +function exec(cmd, options){ logger.addContext("binary", "bin"); logger.debug(`Spawn process '${cmd}'`); - let proc = spawn(bin, args); - - return { - "process": proc, - "stdout": proc.stdout, - "stderr": proc.stderr - } + return spawn(bin, args, options); } // Specify exports