File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const npmRunPath = options => {
20
20
}
21
21
22
22
// Ensure the running `node` binary is used
23
- result . push ( path . dirname ( process . execPath ) ) ;
23
+ result . unshift ( path . dirname ( process . execPath ) ) ;
24
24
25
25
return result . concat ( options . path ) . join ( path . delimiter ) ;
26
26
} ;
Original file line number Diff line number Diff line change @@ -4,12 +4,19 @@ import npmRunPath from '.';
4
4
5
5
test ( 'main' , t => {
6
6
t . is (
7
- npmRunPath ( { path : '' } ) . split ( path . delimiter ) [ 0 ] ,
7
+ npmRunPath ( { path : '' } ) . split ( path . delimiter ) [ 1 ] ,
8
8
path . join ( __dirname , 'node_modules/.bin' )
9
9
) ;
10
10
11
11
t . is (
12
- npmRunPath . env ( { env : { PATH : 'foo' } } ) . PATH . split ( path . delimiter ) [ 0 ] ,
12
+ npmRunPath . env ( { env : { PATH : 'foo' } } ) . PATH . split ( path . delimiter ) [ 1 ] ,
13
13
path . join ( __dirname , 'node_modules/.bin' )
14
14
) ;
15
15
} ) ;
16
+
17
+ test ( 'push `execPath` to the front of the PATH' , t => {
18
+ t . is (
19
+ npmRunPath ( { path : '' } ) . split ( path . delimiter ) [ 0 ] ,
20
+ path . dirname ( process . execPath )
21
+ ) ;
22
+ } ) ;
You can’t perform that action at this time.
0 commit comments