From d918bb568c80e063b3006532e9e6e527c01ac243 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 23 Jun 2019 12:09:43 +0100 Subject: [PATCH] Ignore empty examples directories (don't add to import menu) --- packages/node_modules/@node-red/registry/lib/library.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/registry/lib/library.js b/packages/node_modules/@node-red/registry/lib/library.js index 1eea6ed56..fcb5e1eac 100644 --- a/packages/node_modules/@node-red/registry/lib/library.js +++ b/packages/node_modules/@node-red/registry/lib/library.js @@ -51,7 +51,9 @@ function getFlowsFromPath(path) { } i++; }) - + if (!result.hasOwnProperty("f")) { + reject(result); + } resolve(result); }) }); @@ -63,7 +65,7 @@ function addNodeExamplesDir(module,path) { return getFlowsFromPath(path).then(function(result) { exampleFlows = exampleFlows||{}; exampleFlows[module] = result; - }); + }, function() { return; }); } function removeNodeExamplesDir(module) { delete exampleRoots[module];