1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Modules not properly removed from config.json

This commit is contained in:
Nick O'Leary 2015-03-22 21:48:12 +00:00
parent 81df74dfc8
commit e19b8d35a9

View File

@ -67,23 +67,26 @@ var registry = (function() {
for (var module in moduleConfigs) { for (var module in moduleConfigs) {
if (moduleConfigs.hasOwnProperty(module)) { if (moduleConfigs.hasOwnProperty(module)) {
if (!moduleList[module]) { if (Object.keys(moduleConfigs[module].nodes).length > 0) {
moduleList[module] = { if (!moduleList[module]) {
name: module, moduleList[module] = {
version: moduleConfigs[module].version, name: module,
nodes: {} version: moduleConfigs[module].version,
}; nodes: {}
} };
var nodes = moduleConfigs[module].nodes; }
for(var node in nodes) { var nodes = moduleConfigs[module].nodes;
if (nodes.hasOwnProperty(node)) { for(var node in nodes) {
var config = nodes[node]; if (nodes.hasOwnProperty(node)) {
var n = filterNodeInfo(config); var config = nodes[node];
delete n.loaded; var n = filterNodeInfo(config);
delete n.err; delete n.loaded;
delete n.file; delete n.err;
delete n.id; delete n.file;
moduleList[module].nodes[node] = n; delete n.id;
n.file = config.file;
moduleList[module].nodes[node] = n;
}
} }
} }
} }
@ -208,6 +211,7 @@ var registry = (function() {
infoList.push(registry.removeNode(module+"/"+nodes[i])); infoList.push(registry.removeNode(module+"/"+nodes[i]));
} }
delete moduleNodes[module]; delete moduleNodes[module];
delete moduleConfigs[module];
saveNodeList(); saveNodeList();
return infoList; return infoList;
}, },
@ -440,6 +444,7 @@ var registry = (function() {
removed = true; removed = true;
} }
} }
delete moduleConfigs[mod];
} }
} }
} }