Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Save the base path so that loadAdditionalConfig works in node
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Jan 28, 2017
1 parent aac379a commit 9b177c7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions architect.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if (typeof module === "object") (function () {
var exists = require('fs').exists || require('path').exists;
var realpath = require('fs').realpath;
var packagePathCache = {};
var basePath;

exports.loadConfig = loadConfig;
exports.resolveConfig = resolveConfig;
Expand All @@ -32,6 +33,14 @@ if (typeof module === "object") (function () {
}

function resolveConfig(config, base, callback) {
if(typeof base === 'function') {
// probably being called from loadAdditionalConfig, use saved base
callback = base;
base = basePath;
} else {
basePath = base;
}

if (!callback)
return resolveConfigSync(config, base);
else
Expand Down

0 comments on commit 9b177c7

Please sign in to comment.