mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 01:26:29 -04:00
Merge remote-tracking branch 'olexs/deprecated-config-notify' into deprecated-options
This commit is contained in:
commit
fd7fe129e2
4 changed files with 30 additions and 0 deletions
16
js/app.js
16
js/app.js
|
@ -61,6 +61,7 @@ var App = function() {
|
|||
try {
|
||||
fs.accessSync(configFilename, fs.F_OK);
|
||||
var c = require(configFilename);
|
||||
checkDeprecatedOptions(c);
|
||||
var config = Object.assign(defaults, c);
|
||||
callback(config);
|
||||
} catch (e) {
|
||||
|
@ -77,6 +78,21 @@ var App = function() {
|
|||
}
|
||||
};
|
||||
|
||||
var checkDeprecatedOptions = function(userConfig) {
|
||||
var deprecatedOptions = require(__dirname + "/../config/deprecated.js");
|
||||
var usedDeprecated = [];
|
||||
|
||||
deprecatedOptions.forEach(function(option) {
|
||||
if (userConfig.hasOwnProperty(option)) {
|
||||
usedDeprecated.push(option);
|
||||
}
|
||||
});
|
||||
|
||||
if (usedDeprecated.length > 0) {
|
||||
console.error("WARNING! Your config is using deprecated options: " + usedDeprecated.join(", ") + ". Check README and CHANGELOG for more up-to-date ways of getting the same functionality.");
|
||||
}
|
||||
}
|
||||
|
||||
/* loadModule(module)
|
||||
* Loads a specific module.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue