File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 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 1111 ! process . argv
1212 || process . argv . length < 2
1313 || ( 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 )
1515 )
1616) {
1717 console . error ( 'Error: `resolve` must be run directly as an executable' ) ;
You can’t perform that action at this time.
0 commit comments