mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	better handle example file at any depth
This commit is contained in:
		@@ -51,9 +51,6 @@ function getFlowsFromPath(path) {
 | 
			
		||||
                    }
 | 
			
		||||
                    i++;
 | 
			
		||||
                })
 | 
			
		||||
                if (!result.hasOwnProperty("f")) {
 | 
			
		||||
                    reject(result);
 | 
			
		||||
                }
 | 
			
		||||
                resolve(result);
 | 
			
		||||
            })
 | 
			
		||||
        });
 | 
			
		||||
@@ -63,9 +60,10 @@ 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;
 | 
			
		||||
    }, function() { return; });
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
function removeNodeExamplesDir(module) {
 | 
			
		||||
    delete exampleRoots[module];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user