File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : resolve executable
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ _ :
7
+ name : cli
8
+
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - uses : actions/checkout@v4
13
+ - uses : ljharb/actions/node/install@main
14
+ - run : " [ $(./bin/resolve fs) = 'fs' ]"
15
+ name : run inside the package with a direct path
16
+ - run : " npm link && [ $(resolve fs) = 'fs' ] && npm uninstall -g resolve"
17
+ name : run linked as a global in the PATH
18
+ - run : " [ $(npx resolve fs) = 'fs' ]"
19
+ name : run via npx
Original file line number Diff line number Diff line change 11
11
! process . argv
12
12
|| process . argv . length < 2
13
13
|| ( process . argv [ 1 ] !== __filename && fs . statSync ( process . argv [ 1 ] ) . ino !== fs . statSync ( __filename ) . ino )
14
- || ( process . env . _ && fs . realpathSync ( path . resolve ( process . env . _ ) ) !== __filename )
14
+ || ( process . env . npm_lifecycle_event !== 'npx' && process . env . _ && fs . realpathSync ( path . resolve ( process . env . _ ) ) !== __filename )
15
15
)
16
16
) {
17
17
console . error ( 'Error: `resolve` must be run directly as an executable' ) ;
You can’t perform that action at this time.
0 commit comments