From 9faa1459c99387fdfedd1dd54a43345b166cb178 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Tue, 8 Nov 2022 03:06:50 +0100 Subject: [PATCH] with-post-step: use option 'shell: true' by default and do not split args This fixes a breaking change introduced in #46. 'exec' executes commands on the shell by default, while 'spawn' does not. --- with-post-step/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/with-post-step/main.js b/with-post-step/main.js index 45caf18..107ec21 100644 --- a/with-post-step/main.js +++ b/with-post-step/main.js @@ -27,11 +27,8 @@ const { spawn } = require("child_process"); const fs = require('fs'); -function run(cmdline) { - var args = cmdline.split(" "); - const cmd = args.shift(); - - const subprocess = spawn(cmd, args, { stdio: "inherit" }); +function run(cmd) { + const subprocess = spawn(cmd, { stdio: "inherit", shell: true }); subprocess.on("exit", (exitCode) => { process.exitCode = exitCode; });