bugfix find wrapper
This commit is contained in:
parent
7875d9d0c9
commit
27bee1b8de
10
manager.js
10
manager.js
|
@ -179,7 +179,7 @@ Manage.create = function(CONF) {
|
||||||
|
|
||||||
function _mergeFind(config, ours, theirs) {
|
function _mergeFind(config, ours, theirs) {
|
||||||
theirs.forEach(function(_newer) {
|
theirs.forEach(function(_newer) {
|
||||||
ours.some(function(_older) {
|
var hasCurrent = ours.some(function(_older) {
|
||||||
if (_newer.subject !== _older.subject) {
|
if (_newer.subject !== _older.subject) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -193,6 +193,9 @@ Manage.create = function(CONF) {
|
||||||
// handled the (only) match
|
// handled the (only) match
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
if (hasCurrent) {
|
||||||
|
manage._merge(config, null, _newer);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// delete the things that are gone
|
// delete the things that are gone
|
||||||
|
@ -209,7 +212,10 @@ Manage.create = function(CONF) {
|
||||||
await manage._save(config);
|
await manage._save(config);
|
||||||
// everything was either added, updated, or not different
|
// everything was either added, updated, or not different
|
||||||
// hence, this is everything
|
// 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;
|
return manage._txPromise;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "greenlock-manager-fs",
|
"name": "greenlock-manager-fs",
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"description": "A simple file-based management strategy for Greenlock",
|
"description": "A simple file-based management strategy for Greenlock",
|
||||||
"main": "manager.js",
|
"main": "manager.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in New Issue