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

Store version in settings

This commit is contained in:
Anna Thomas 2014-12-08 09:43:59 +00:00
parent 6d0dffcdf7
commit bb0e48f271

View File

@ -68,9 +68,18 @@ var registry = (function() {
for (var module in moduleConfigs) {
if (moduleConfigs.hasOwnProperty(module)) {
if (!moduleList[module]) {
moduleList[module] = {};
moduleList[module].name = module;
moduleList[module].nodes = {};
var version;
if (module === "node-red") {
version = settings.version;
} else {
version = moduleConfigs[module].version;
}
moduleList[module] = {
name: module,
version: version,
nodes: {}
};
}
var nodes = moduleConfigs[module].nodes;
for(var node in nodes) {
@ -114,21 +123,21 @@ var registry = (function() {
nodeSetName = nodeConfig.name.split(":")[1];
} else {
moduleName = "node-red";
nodeSetName = nodeConfig.name.replace(/^\d+-/,"").replace(/\.js$/,"")
nodeSetName = nodeConfig.name.replace(/^\d+-/,"").replace(/\.js$/,"");
}
if (!newConfigs[moduleName]) {
newConfigs[moduleName] = {
name: moduleName,
nodes:{}
}
};
}
newConfigs[moduleName].nodes[nodeSetName] = {
name: nodeSetName,
types: nodeConfig.types,
enabled: nodeConfig.enabled,
module: moduleName
}
};
}
}
settings.set("nodes",newConfigs);
@ -625,6 +634,7 @@ function loadNodeConfig(file,module,name,version) {
node.err = err.toString();
}
}
registry.addNodeSet(id,node,version);
return node;
}