mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 07:04:32 +02:00
More Hot-Reload related changes
* Config.get(): Returns the latest config * Update code all over the place to use Config.get() vs Config.conf (which will be deprecated)
This commit is contained in:
parent
ca0149eaf0
commit
1fe46894d3
42 changed files with 320 additions and 273 deletions
|
@ -13,6 +13,8 @@ const assert = require('assert');
|
|||
exports.init = init;
|
||||
exports.getDefaultPath = getDefaultPath;
|
||||
|
||||
let currentConfiguration = {};
|
||||
|
||||
function hasMessageConferenceAndArea(config) {
|
||||
assert(_.isObject(config.messageConferences)); // we create one ourself!
|
||||
|
||||
|
@ -67,12 +69,10 @@ function mergeValidateAndFinalize(config, cb) {
|
|||
return callback(null, mergedConfig);
|
||||
},
|
||||
function setIt(mergedConfig, callback) {
|
||||
exports.config = mergedConfig;
|
||||
|
||||
exports.config.get = (path) => {
|
||||
return _.get(exports.config, path);
|
||||
};
|
||||
// :TODO: .config property is to be deprecated once conversions are done
|
||||
exports.config = currentConfiguration = mergedConfig;
|
||||
|
||||
exports.get = () => currentConfiguration;
|
||||
return callback(null);
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue