Skip to content

Commit e05488c

Browse files
committed
Run *.cmd commands with shell: true
This bypasses EINVAL [1] errors seen in CI on Windows. [1] https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
1 parent 982ee5e commit e05488c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

features/support/world.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,22 @@ export default class CustomWorld implements ICustomWorld {
9797
extraEnv: Record<string, string>;
9898
expectedExitCode?: number;
9999
}) {
100+
const shell = cmd.endsWith(".cmd");
101+
102+
if (shell) {
103+
// https://github.com/nodejs/node/issues/29532
104+
args = args.map((arg) => `"${arg}"`);
105+
}
106+
100107
const child = childProcess.spawn(cmd, args, {
101108
stdio: ["ignore", "pipe", "pipe"],
102109
cwd: this.tmpDir,
103110
env: {
104111
...process.env,
105112
...extraEnv,
106113
},
114+
// https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
115+
shell,
107116
});
108117

109118
const combined = combine(child.stdout, child.stderr);

0 commit comments

Comments
 (0)