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.
This commit is contained in:
Unai Martinez-Corral
2022-11-08 03:06:50 +01:00
committed by umarcor
parent eb1108c0f0
commit 9faa1459c9

View File

@@ -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;
});