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

Handle null coreNodesPath

This commit is contained in:
Nick O'Leary 2015-12-06 23:29:58 +00:00
parent 05b58e9263
commit d5f2255a68
2 changed files with 18 additions and 12 deletions

View File

@ -136,7 +136,9 @@ function start() {
redNodes.cleanModuleList();
}
}
if (settings.settingsFile) {
log.info(log._("runtime.paths.settings",{path:settings.settingsFile}));
}
redNodes.loadFlows().then(redNodes.startFlows);
}).otherwise(function(err) {
console.log(err);

View File

@ -140,6 +140,7 @@ function scanTreeForNodesModules(moduleName) {
results = results.concat(scanDirForNodesModules(userDir,moduleName));
}
if (dir) {
var up = path.resolve(path.join(dir,".."));
while (up !== dir) {
var pm = path.join(dir,"node_modules");
@ -149,6 +150,7 @@ function scanTreeForNodesModules(moduleName) {
dir = up;
up = path.resolve(path.join(dir,".."));
}
}
return results;
}
@ -188,11 +190,13 @@ function getModuleNodeFiles(module) {
function getNodeFiles(disableNodePathScan) {
var dir;
// Find all of the nodes to load
var nodeFiles = getLocalNodeFiles(path.resolve(settings.coreNodesDir));
//console.log(nodeFiles);
var nodeFiles = [];
if (settings.coreNodesDir) {
nodeFiles = getLocalNodeFiles(path.resolve(settings.coreNodesDir));
var defaultLocalesPath = path.resolve(path.join(settings.coreNodesDir,"core","locales"));
i18n.registerMessageCatalog("node-red",defaultLocalesPath,"messages.json");
}
if (settings.userDir) {
dir = path.join(settings.userDir,"nodes");