Skip to content

Commit

Permalink
[PDE-5065] cli(fix): Add shell: true as a default option for Window…
Browse files Browse the repository at this point in the history
…s users when running spawn() command (#788)

* add shell: true as an option for Windows

* review suggestion
  • Loading branch information
rnegron authored May 27, 2024
1 parent 0ba70f9 commit 360feed
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/cli/src/utils/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ const isWindows = () => {

// Run a bash command with a promise.
const runCommand = (command, args, options) => {
if (isWindows()) {
command += '.cmd';
}

if (_.get(global, ['argOpts', 'debug'])) {
debug.enabled = true;
}

options = options || {};

if (isWindows()) {
command += '.cmd';

// See CVE-2024-27980
options.shell = true;
}

debug('\n');
debug(
`Running ${colors.bold(
Expand Down

0 comments on commit 360feed

Please sign in to comment.