File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,26 @@ function run(options) {
4848 stdio : stdio ,
4949 }
5050
51+ var executable = cmd . executable ;
52+
5153 if ( utils . isWindows ) {
54+ // if the exec includes a forward slash, reverse it for windows compat
55+ // but *only* apply to the first command, and none of the arguments.
56+ // ref #1251 and #1236
57+ if ( executable . indexOf ( '/' ) !== - 1 ) {
58+ executable = executable . split ( ' ' ) . map ( ( e , i ) => {
59+ if ( i === 0 ) {
60+ return path . normalize ( e ) ;
61+ }
62+ return e ;
63+ } ) . join ( ' ' ) ;
64+ }
5265 // taken from npm's cli: https://git.io/vNFD4
5366 sh = process . env . comspec || 'cmd' ;
5467 shFlag = '/d /s /c' ;
5568 spawnOptions . windowsVerbatimArguments = true ;
5669 }
5770
58- var executable = cmd . executable ;
5971 var args = runCmd ? utils . stringify ( executable , cmd . args ) : ':' ;
6072 var spawnArgs = [ sh , [ shFlag , args ] , spawnOptions ] ;
6173
You can’t perform that action at this time.
0 commit comments