Skip to content

Commit

Permalink
fix: Only resolve symbolic links if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Kellen authored and phated committed Nov 22, 2021
1 parent 8842467 commit 8d701bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ Liftoff.prototype.buildEnvironment = function (opts) {
if (!opts.cwd) {
cwd = configBase;
}
// resolve symlink if needed
if(fs.lstatSync(configPath).isSymbolicLink()) {
configPath = fs.realpathSync(configPath);
}
}

// TODO: break this out into lib/
Expand Down Expand Up @@ -125,7 +129,7 @@ Liftoff.prototype.buildEnvironment = function (opts) {
cwd: cwd,
require: preload,
configNameSearch: configNameSearch,
configPath: configPath && fs.realpathSync(configPath), // resolve symlink
configPath: configPath,
configBase: configBase,
modulePath: modulePath,
modulePackage: modulePackage||{}
Expand Down

0 comments on commit 8d701bd

Please sign in to comment.