mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'master' into dev
This commit is contained in:
@@ -27,17 +27,19 @@ async function getFlowsFromPath(path) {
|
||||
var validFiles = [];
|
||||
return fs.readdir(path).then(files => {
|
||||
var promises = [];
|
||||
files.forEach(function(file) {
|
||||
var fullPath = fspath.join(path,file);
|
||||
var stats = fs.lstatSync(fullPath);
|
||||
if (stats.isDirectory()) {
|
||||
validFiles.push(file);
|
||||
promises.push(getFlowsFromPath(fullPath));
|
||||
} else if (/\.json$/.test(file)){
|
||||
validFiles.push(file);
|
||||
promises.push(Promise.resolve(file.split(".")[0]))
|
||||
}
|
||||
})
|
||||
if (files) {
|
||||
files.forEach(function(file) {
|
||||
var fullPath = fspath.join(path,file);
|
||||
var stats = fs.lstatSync(fullPath);
|
||||
if (stats.isDirectory()) {
|
||||
validFiles.push(file);
|
||||
promises.push(getFlowsFromPath(fullPath));
|
||||
} else if (/\.json$/.test(file)){
|
||||
validFiles.push(file);
|
||||
promises.push(Promise.resolve(file.split(".")[0]))
|
||||
}
|
||||
})
|
||||
}
|
||||
return Promise.all(promises)
|
||||
}).then(results => {
|
||||
results.forEach(function(r,i) {
|
||||
|
Reference in New Issue
Block a user