From bd0da63f4c9d9222f0423efa4b14f4869e0c62a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 21 Feb 2017 20:21:46 -0300 Subject: [PATCH] use colors for warning message in deprecated options --- js/app.js | 12 +++++++----- js/deprecated.js | 5 ++++- package.json | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/js/app.js b/js/app.js index 5582df58..9c1ef74d 100644 --- a/js/app.js +++ b/js/app.js @@ -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.") ); } } diff --git a/js/deprecated.js b/js/deprecated.js index 8632d775..5df1d71f 100644 --- a/js/deprecated.js +++ b/js/deprecated.js @@ -5,9 +5,12 @@ * * Olex S. original idea this deprecated option */ +var colors = require("colors/safe"); +colors.setTheme({warn: "yellow"}) var deprecated = { - configs: ["kioskmode"] + configs: ["kioskmode"], + colors: colors }; /*************** DO NOT EDIT THE LINE BELOW ***************/ diff --git a/package.json b/package.json index e687ecb8..704f8394 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "time-grunt": "latest" }, "dependencies": { + "colors": "^1.1.2", "electron": "^1.4.7", "express": "^4.14.0", "express-ipfilter": "latest",