1
0
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:
Nick O'Leary 2019-06-29 21:32:07 +01:00 committed by GitHub
commit a974e84ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}); });