File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,19 @@ if (!command) {
2525// Log the command being executed
2626console . 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
You can’t perform that action at this time.
0 commit comments