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:
Nick O'Leary
2019-06-29 21:32:07 +01:00
committed by GitHub

View File

@@ -51,7 +51,6 @@ function getFlowsFromPath(path) {
}
i++;
})
resolve(result);
})
});
@@ -61,6 +60,7 @@ function getFlowsFromPath(path) {
function addNodeExamplesDir(module,path) {
exampleRoots[module] = path;
return getFlowsFromPath(path).then(function(result) {
if (JSON.stringify(result).indexOf('{"f":') === -1) { return; }
exampleFlows = exampleFlows||{};
exampleFlows[module] = result;
});