Skip to content

Commit

Permalink
Merge pull request #1688 from dcdenu4/bugfix/plugins-spawn-missing-sh…
Browse files Browse the repository at this point in the history
…ell-true

Spawn call was missing shell true option
  • Loading branch information
emlys authored Nov 22, 2024
2 parents f98f272 + 276632d commit e6318a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions workbench/src/main/setupAddRemovePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const logger = getLogger(__filename.split('/').slice(-1)[0]);
* Spawn a child process and log its stdout, stderr, and any error in spawning.
*
* child_process.spawn is called with the provided cmd, args, and options,
* and the windowsHide option set to true.
* and the windowsHide option set to true. The shell option is set to true
* because spawn by default sets shell to false.
*
* Required properties missing from the store are initialized with defaults.
* Invalid properties are reset to defaults.
Expand All @@ -27,7 +28,8 @@ const logger = getLogger(__filename.split('/').slice(-1)[0]);
*/
function spawnWithLogging(cmd, args, options) {
logger.info(cmd, args);
const cmdProcess = spawn(cmd, args, { ...options, windowsHide: true });
const cmdProcess = spawn(
cmd, args, { ...options, shell: true, windowsHide: true });
if (cmdProcess.stdout) {
cmdProcess.stderr.on('data', (data) => logger.info(data.toString()));
cmdProcess.stdout.on('data', (data) => logger.info(data.toString()));
Expand Down

0 comments on commit e6318a6

Please sign in to comment.