diff --git a/CHANGELOG.md b/CHANGELOG.md index 56bd5fc1..1138da27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Estonian Translation. - Add test for compliments module for parts of day - Korean Translation. +- Added console warning on startup when deprecated config options are used ### Fixed @@ -92,7 +93,6 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added ability to configure electronOptions - Calendar module: option to hide private events - Add root_path for global vars -- Added console warning on startup when deprecated config options are used ### Updated - Modified translations for Frysk. diff --git a/config/.gitignore b/config/.gitignore index daeb6336..d85e3bd4 100644 --- a/config/.gitignore +++ b/config/.gitignore @@ -1,3 +1,2 @@ * !config.js.sample -!deprecated.js diff --git a/js/app.js b/js/app.js index 792b9047..5582df58 100644 --- a/js/app.js +++ b/js/app.js @@ -79,7 +79,7 @@ var App = function() { }; var checkDeprecatedOptions = function(userConfig) { - var deprecatedOptions = require(__dirname + "/../config/deprecated.js"); + var deprecatedOptions = require(global.root_path + "/js/deprecated.js").configs; var usedDeprecated = []; deprecatedOptions.forEach(function(option) { @@ -89,7 +89,11 @@ var App = function() { }); 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."); + 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." + ); } } diff --git a/config/deprecated.js b/js/deprecated.js similarity index 52% rename from config/deprecated.js rename to js/deprecated.js index cf305582..8632d775 100644 --- a/config/deprecated.js +++ b/js/deprecated.js @@ -2,11 +2,13 @@ * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. + * + * Olex S. original idea this deprecated option */ -var deprecated = [ - 'kioskmode' -]; +var deprecated = { + configs: ["kioskmode"] +}; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = deprecated;} +if (typeof module !== "undefined") {module.exports = deprecated;}