File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -1270,10 +1270,8 @@ class Command extends EventEmitter {
1270
1270
default :
1271
1271
throw new Error ( `unexpected parse option { from: '${ parseOptions . from } ' }` ) ;
1272
1272
}
1273
- // @ts -ignore: unknown property
1274
- if ( ! this . _scriptPath && process . mainModule ) {
1275
- // @ts -ignore: unknown property
1276
- this . _scriptPath = process . mainModule . filename ;
1273
+ if ( ! this . _scriptPath && require . main ) {
1274
+ this . _scriptPath = require . main . filename ;
1277
1275
}
1278
1276
1279
1277
// Guess name, used in usage in help.
@@ -1327,10 +1325,8 @@ class Command extends EventEmitter {
1327
1325
// Want the entry script as the reference for command name and directory for searching for other files.
1328
1326
let scriptPath = this . _scriptPath ;
1329
1327
// Fallback in case not set, due to how Command created or called.
1330
- // @ts -ignore: unknown property
1331
- if ( ! scriptPath && process . mainModule ) {
1332
- // @ts -ignore: unknown property
1333
- scriptPath = process . mainModule . filename ;
1328
+ if ( ! scriptPath && require . main ) {
1329
+ scriptPath = require . main . filename ;
1334
1330
}
1335
1331
1336
1332
let baseDir ;
You can’t perform that action at this time.
0 commit comments