File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,13 @@ var path = require('path');
6
6
var fs = require ( 'fs' ) ;
7
7
8
8
if (
9
- ! process . argv
10
- || process . argv . length < 2
11
- || ( process . argv [ 1 ] !== __filename && fs . statSync ( process . argv [ 1 ] ) . ino !== fs . statSync ( __filename ) . ino )
12
- || ( process . env . _ && path . resolve ( process . env . _ ) !== __filename )
9
+ String ( process . env . npm_lifecycle_script ) . slice ( 0 , 8 ) !== 'resolve '
10
+ && (
11
+ ! process . argv
12
+ || process . argv . length < 2
13
+ || ( process . argv [ 1 ] !== __filename && fs . statSync ( process . argv [ 1 ] ) . ino !== fs . statSync ( __filename ) . ino )
14
+ || ( process . env . _ && path . resolve ( process . env . _ ) !== __filename )
15
+ )
13
16
) {
14
17
console . error ( 'Error: `resolve` must be run directly as an executable' ) ;
15
18
process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments