From 9b177c7e97e92849f4e7a46f732b8c7d32ab319b Mon Sep 17 00:00:00 2001 From: John Ferlito Date: Sat, 28 Jan 2017 14:17:29 +1100 Subject: [PATCH] Save the base path so that loadAdditionalConfig works in node --- architect.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/architect.js b/architect.js index 603915d..090b564 100644 --- a/architect.js +++ b/architect.js @@ -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; @@ -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