mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 13:09:34 +00:00
use colors for warning message in deprecated options
This commit is contained in:
parent
db0b663a3d
commit
bd0da63f4c
12
js/app.js
12
js/app.js
@ -79,7 +79,9 @@ var App = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var checkDeprecatedOptions = function(userConfig) {
|
var checkDeprecatedOptions = function(userConfig) {
|
||||||
var deprecatedOptions = require(global.root_path + "/js/deprecated.js").configs;
|
var deprecated = require(global.root_path + "/js/deprecated.js");
|
||||||
|
var deprecatedOptions = deprecated.configs;
|
||||||
|
|
||||||
var usedDeprecated = [];
|
var usedDeprecated = [];
|
||||||
|
|
||||||
deprecatedOptions.forEach(function(option) {
|
deprecatedOptions.forEach(function(option) {
|
||||||
@ -89,10 +91,10 @@ var App = function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (usedDeprecated.length > 0) {
|
if (usedDeprecated.length > 0) {
|
||||||
console.warn(
|
console.warn(deprecated.colors.warn(
|
||||||
"WARNING! Your config is using deprecated options: ",
|
"WARNING! Your config is using deprecated options: " +
|
||||||
usedDeprecated.join(", "),
|
usedDeprecated.join(", ") +
|
||||||
". Check README and CHANGELOG for more up-to-date ways of getting the same functionality."
|
". Check README and CHANGELOG for more up-to-date ways of getting the same functionality.")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,12 @@
|
|||||||
*
|
*
|
||||||
* Olex S. original idea this deprecated option
|
* Olex S. original idea this deprecated option
|
||||||
*/
|
*/
|
||||||
|
var colors = require("colors/safe");
|
||||||
|
colors.setTheme({warn: "yellow"})
|
||||||
|
|
||||||
var deprecated = {
|
var deprecated = {
|
||||||
configs: ["kioskmode"]
|
configs: ["kioskmode"],
|
||||||
|
colors: colors
|
||||||
};
|
};
|
||||||
|
|
||||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
"time-grunt": "latest"
|
"time-grunt": "latest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"colors": "^1.1.2",
|
||||||
"electron": "^1.4.7",
|
"electron": "^1.4.7",
|
||||||
"express": "^4.14.0",
|
"express": "^4.14.0",
|
||||||
"express-ipfilter": "latest",
|
"express-ipfilter": "latest",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user