mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-15 05:53:50 +02:00
Working well
This commit is contained in:
parent
56472c80a8
commit
37bc2fc3aa
1 changed files with 7 additions and 4 deletions
|
@ -149,23 +149,26 @@ module.exports = class ConfigLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
const prev = stack[stack.length - 1];
|
const prev = stack[stack.length - 1];
|
||||||
|
|
||||||
if (source === prev.source) {
|
if (source === prev.source) {
|
||||||
path = prev.path.concat(key);
|
path = prev.path.concat(key);
|
||||||
stack.push({source : configVal, path});
|
stack.push({source : configVal, path});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.pop();
|
stack.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
path = path.join('.');
|
path = path.join('.');
|
||||||
return options.defaultsCustomizer(defaultVal, configVal, key, path);
|
return options.defaultsCustomizer(defaultVal, configVal, key, path);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return callback(null, mergedConfig);
|
return callback(null, mergedConfig);
|
||||||
} else {
|
|
||||||
// :TODO: correct?
|
|
||||||
_.defaultsDeep(config, options.defaultConfig);
|
|
||||||
return callback(null, config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// :TODO: correct?
|
||||||
|
return callback(null, _.merge(options.defaultConfig, config));
|
||||||
},
|
},
|
||||||
(config, callback) => {
|
(config, callback) => {
|
||||||
const configRoot = paths.dirname(basePath);
|
const configRoot = paths.dirname(basePath);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue