Skip to content

Commit

Permalink
Add shell=true when spawning cmd files in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hallipr committed May 21, 2024
1 parent 1f91e16 commit 4c9c644
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions eng/scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function run(command, args, options) {

if (process.platform === "win32" && isCmdOnWindows.includes(command)) {
command += ".cmd";
// When spawning .bat or .cmd files on windows, node will now error with EINVAL if shell is not set to true.
// https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
options.shell = true;
}

const proc = (options.sync ? spawnSync : spawn)(command, args, options);
Expand Down

0 comments on commit 4c9c644

Please sign in to comment.