Skip to content
Myr

Improve basedir calculation to fix #1274 (#1322)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Improve basedir calculation to fix #1274 * Improve comment

authored by John Gee · committed by GitHub · parent c7f5f78 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:index.js+5 added-1 removed
821 unmodified lines
822 // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.823 this._checkForMissingMandatoryOptions();824825 // Want the entry script as the reference for command name and directory for searching for other files.826 const scriptPath = this._scriptPath;826 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 }831832 let baseDir;833 try {834 const resolvedLink = fs.realpathSync(scriptPath);
1016 unmodified lines