Skip to content

Commit

Permalink
Get node-red core nodes back to the top of the list
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Feb 17, 2021
1 parent e6ec590 commit f96ce2f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/node_modules/@node-red/registry/lib/localfilesystem.js
Expand Up @@ -305,13 +305,15 @@ function getNodeFiles(disableNodePathScan) {
}
}

var nodeList = {};
var coreNodeEntry = {
name: "node-red",
version: settings.version,
nodes: {},
icons: iconList
}
var nodeList = {
"node-red": coreNodeEntry
};
nodeFiles.forEach(function(node) {
coreNodeEntry.nodes[node.name] = node;
});
Expand Down Expand Up @@ -370,11 +372,10 @@ function getNodeFiles(disableNodePathScan) {
}
return true;
});
nodeList = convertModuleFileListToObject(moduleFiles);
nodeList = convertModuleFileListToObject(moduleFiles, nodeList);
} else {
// console.log("node path scan disabled");
}
nodeList["node-red"] = coreNodeEntry;
return nodeList;
}

Expand All @@ -392,8 +393,8 @@ function getModuleFiles(module) {
return convertModuleFileListToObject(moduleFiles);
}

function convertModuleFileListToObject(moduleFiles) {
const nodeList = {};
function convertModuleFileListToObject(moduleFiles,seedObject) {
const nodeList = seedObject || {};
moduleFiles.forEach(function(moduleFile) {

var nodeModuleFiles = getModuleNodeFiles(moduleFile);
Expand Down

0 comments on commit f96ce2f

Please sign in to comment.