Skip to content

Commit b9cfb54

Browse files
committed
fix for window
1 parent 83d1d02 commit b9cfb54

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/post-deploy-validation.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ function formatResult(result) {
3131
return `${stdout}${stderr}`;
3232
}
3333

34+
function shouldUseShellForCommand(command) {
35+
if (process.platform !== 'win32') {
36+
return false;
37+
}
38+
39+
const normalized = command.toLowerCase();
40+
return normalized.endsWith('.cmd') || normalized.endsWith('.bat');
41+
}
42+
3443
function runCommand(command, args, options = {}) {
3544
const { cwd, env, allowFailure = false, timeoutMs = 5 * 60 * 1000 } = options;
3645

@@ -42,6 +51,7 @@ function runCommand(command, args, options = {}) {
4251
...env,
4352
},
4453
stdio: ['ignore', 'pipe', 'pipe'],
54+
shell: shouldUseShellForCommand(command),
4555
});
4656

4757
let stdout = '';
@@ -214,6 +224,7 @@ function runInteractiveNpxCreate({ workspace, steps, timeoutMs = 3 * 60 * 1000 }
214224
...process.env,
215225
},
216226
stdio: ['pipe', 'pipe', 'pipe'],
227+
shell: shouldUseShellForCommand(npxCommand),
217228
});
218229

219230
let stdout = '';

0 commit comments

Comments
 (0)