mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2222 from node-red/no-empty-examples
Ignore empty examples directories (don't add to import menu)
This commit is contained in:
commit
a974e84ad1
@ -51,7 +51,6 @@ function getFlowsFromPath(path) {
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
})
|
})
|
||||||
|
|
||||||
resolve(result);
|
resolve(result);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@ -61,6 +60,7 @@ function getFlowsFromPath(path) {
|
|||||||
function addNodeExamplesDir(module,path) {
|
function addNodeExamplesDir(module,path) {
|
||||||
exampleRoots[module] = path;
|
exampleRoots[module] = path;
|
||||||
return getFlowsFromPath(path).then(function(result) {
|
return getFlowsFromPath(path).then(function(result) {
|
||||||
|
if (JSON.stringify(result).indexOf('{"f":') === -1) { return; }
|
||||||
exampleFlows = exampleFlows||{};
|
exampleFlows = exampleFlows||{};
|
||||||
exampleFlows[module] = result;
|
exampleFlows[module] = result;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user