Skip to content

Commit

Permalink
feat!: Lookup configPath in configFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Mar 13, 2024
1 parent 466e17b commit 54c8b04
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ Liftoff.prototype.buildEnvironment = function (opts) {
return loadConfig(cwd, startingLocation, defaultConfig);
});

var configPathOverride = arrayFind(Object.keys(config), function (key) {
var cfg = config[key];
if (Object.prototype.hasOwnProperty.call(cfg, this.configName)) {
return cfg[this.configName]
}
});

// if cwd was provided explicitly, only use it for searching config
if (opts.cwd) {
searchPaths = [cwd];
Expand All @@ -164,7 +171,7 @@ Liftoff.prototype.buildEnvironment = function (opts) {
var configPath = findConfig({
configNameSearch: configNameSearch,
searchPaths: searchPaths,
configPath: opts.configPath,
configPath: opts.configPath || configPathOverride,
});

// if we have a config path, save the directory it resides in.
Expand Down

0 comments on commit 54c8b04

Please sign in to comment.