Skip to content

Commit db3f0a8

Browse files
committed
refactor: wip
1 parent 7608828 commit db3f0a8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tools/scripts/ci-tsx.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ if (!command) {
2525
// Log the command being executed
2626
console.log(`> ${command} ${args.join(' ')}`);
2727

28-
// Spawn the command with the configured environment
29-
const child = spawn(command, args, {
28+
// Handle Windows-specific command execution
29+
// On Windows, npm bin scripts need .cmd extension (e.g., nx.cmd)
30+
const isWindows = process.platform === 'win32';
31+
const commandToRun =
32+
isWindows && !command.endsWith('.exe') && !command.endsWith('.cmd')
33+
? `${command}.cmd`
34+
: command;
35+
36+
// Spawn the command with the configured environment without shell
37+
// This avoids the DEP0190 deprecation warning
38+
const child = spawn(commandToRun, args, {
3039
env,
3140
stdio: 'inherit',
32-
shell: true,
3341
});
3442

3543
// Forward exit code

0 commit comments

Comments
 (0)