diff --git a/manager.js b/manager.js index 77f66be..da3f4eb 100644 --- a/manager.js +++ b/manager.js @@ -179,7 +179,7 @@ Manage.create = function(CONF) { function _mergeFind(config, ours, theirs) { theirs.forEach(function(_newer) { - ours.some(function(_older) { + var hasCurrent = ours.some(function(_older) { if (_newer.subject !== _older.subject) { return false; } @@ -193,6 +193,9 @@ Manage.create = function(CONF) { // handled the (only) match return true; }); + if (hasCurrent) { + manage._merge(config, null, _newer); + } }); // delete the things that are gone @@ -209,7 +212,10 @@ Manage.create = function(CONF) { await manage._save(config); // everything was either added, updated, or not different // hence, this is everything - return JSON.parse(JSON.stringify(config.sites)); + var copy = JSON.parse(JSON.stringify(config.sites)); + return Object.keys(copy).map(function(k) { + return copy[k]; + }); }); return manage._txPromise; diff --git a/package.json b/package.json index 46e7166..19a113b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlock-manager-fs", - "version": "3.0.2", + "version": "3.0.3", "description": "A simple file-based management strategy for Greenlock", "main": "manager.js", "scripts": {