use colors for warning message in deprecated options

This commit is contained in:
Rodrigo Ramírez Norambuena
2017-02-21 20:21:46 -03:00
parent db0b663a3d
commit bd0da63f4c
3 changed files with 12 additions and 6 deletions

View File

@@ -79,7 +79,9 @@ var App = function() {
};
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 = [];
deprecatedOptions.forEach(function(option) {
@@ -89,10 +91,10 @@ var App = function() {
});
if (usedDeprecated.length > 0) {
console.warn(
"WARNING! Your config is using deprecated options: ",
usedDeprecated.join(", "),
". Check README and CHANGELOG for more up-to-date ways of getting the same functionality."
console.warn(deprecated.colors.warn(
"WARNING! Your config is using deprecated options: " +
usedDeprecated.join(", ") +
". Check README and CHANGELOG for more up-to-date ways of getting the same functionality.")
);
}
}