We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7f5f78 commit a71d592Copy full SHA for a71d592
index.js
@@ -823,7 +823,11 @@ Read more on https://git.io/JJc0W`);
823
this._checkForMissingMandatoryOptions();
824
825
// Want the entry script as the reference for command name and directory for searching for other files.
826
- const scriptPath = this._scriptPath;
+ let scriptPath = this._scriptPath;
827
+ // Fallback in case not set, due to how Command created or called.
828
+ if (!scriptPath && process.mainModule) {
829
+ scriptPath = process.mainModule.filename;
830
+ }
831
832
let baseDir;
833
try {
0 commit comments