From ddcd2da61cd316f79589132f21ca7de71133de55 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Sun, 16 Mar 2025 18:51:30 -0700 Subject: [PATCH] refactor: switch to shell.cmd() This swaps out shell.exec() in favor of shell.cmd(). This should offer more reliable performance and consistent behavior. There's a known issue that this causes one test case to fail due to a change in behavior for globbing. --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index cc48b97..5b6bc36 100644 --- a/index.js +++ b/index.js @@ -6,10 +6,9 @@ const proxyifyCmd = (t, ...cmdStart) => { t = t || function _t(...args) { // Wrap all the arguments in quotes const newArgs = cmdStart - .concat(args) - .map((x) => JSON.stringify(x)); + .concat(args); // Run this command in the shell - return origShell.exec.call(this.stdout, newArgs.join(' ')); + return origShell.cmd(...newArgs); }; // Store the list of commands, in case we have a subcommand chain t[cmdArrayAttr] = cmdStart;