From fc0cac0cad9a3fee5fe1910dd5ee31f0bc05223c Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Sat, 11 Apr 2015 22:01:46 +0100 Subject: [PATCH] merge object settings into default settings --- src/node/utils/Settings.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 3886e6453..b7d1f0bc3 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -28,6 +28,7 @@ var jsonminify = require("jsonminify"); var log4js = require("log4js"); var randomString = require("./randomstring"); var suppressDisableMsg = " -- To suppress these warning messages change suppressErrorsInPadText to true in your settings.json\n"; +var _ = require("underscore"); /* Root path of the installation */ exports.root = path.normalize(path.join(npm.dir, "..")); @@ -272,7 +273,11 @@ exports.reloadSettings = function reloadSettings() { //or it's a settings hash, specific to a plugin if(exports[i] !== undefined || i.indexOf('ep_')==0) { - exports[i] = settings[i]; + if (_.isObject(settings[i]) && !_.isArray(settings[i])) { + exports[i] = _.defaults(settings[i], exports[i]); + } else { + exports[i] = settings[i]; + } } //this setting is unkown, output a warning and throw it away else