bugfix find wrapper

This commit is contained in:
AJ ONeal 2019-11-01 23:06:18 +00:00
parent 7875d9d0c9
commit 27bee1b8de
2 changed files with 9 additions and 3 deletions

View File

@ -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;

View File

@ -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": {