Commit 7ffd545 1 parent 0f39b2e commit 7ffd545 Copy full SHA for 7ffd545
File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,26 @@ function run(options) {
48
48
stdio : stdio ,
49
49
}
50
50
51
+ var executable = cmd . executable ;
52
+
51
53
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
+ }
52
65
// taken from npm's cli: https://git.io/vNFD4
53
66
sh = process . env . comspec || 'cmd' ;
54
67
shFlag = '/d /s /c' ;
55
68
spawnOptions . windowsVerbatimArguments = true ;
56
69
}
57
70
58
- var executable = cmd . executable ;
59
71
var args = runCmd ? utils . stringify ( executable , cmd . args ) : ':' ;
60
72
var spawnArgs = [ sh , [ shFlag , args ] , spawnOptions ] ;
61
73
You can’t perform that action at this time.
0 commit comments