mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
loadNodeConfig assumed to always be called with module and name parameters
This commit is contained in:
parent
71bd5cd9e9
commit
9552055b08
@ -475,9 +475,7 @@ function loadNodesFromModule(moduleDir,pkg) {
|
||||
* }
|
||||
*/
|
||||
function loadNodeConfig(file,module,name) {
|
||||
var id = crypto.createHash('sha1').update(file).digest("hex");
|
||||
if (module && name) {
|
||||
var newid = crypto.createHash('sha1').update(module+":"+name).digest("hex");
|
||||
var id = crypto.createHash('sha1').update(module+":"+name).digest("hex");
|
||||
var existingInfo = registry.getNodeInfo(id);
|
||||
if (existingInfo) {
|
||||
// For a brief period, id for modules were calculated incorrectly.
|
||||
@ -485,9 +483,6 @@ function loadNodeConfig(file,module,name) {
|
||||
registry.removeNode(id);
|
||||
registry.saveNodeList();
|
||||
}
|
||||
id = newid;
|
||||
|
||||
}
|
||||
var info = registry.getNodeInfo(id);
|
||||
|
||||
var isEnabled = true;
|
||||
@ -507,12 +502,8 @@ function loadNodeConfig(file,module,name) {
|
||||
loaded:false
|
||||
};
|
||||
|
||||
if (module) {
|
||||
node.name = module+":"+name;
|
||||
node.module = module;
|
||||
} else {
|
||||
node.name = path.basename(file);
|
||||
}
|
||||
try {
|
||||
var content = fs.readFileSync(node.template,'utf8');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user