mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2997 from hardillb/watch-fix
Watch node throws errors if new files deleted
This commit is contained in:
commit
f8b61d2926
@ -23,9 +23,13 @@ module.exports = function(RED) {
|
|||||||
var getAllDirs = function (dir, filelist) {
|
var getAllDirs = function (dir, filelist) {
|
||||||
filelist = filelist || [];
|
filelist = filelist || [];
|
||||||
fs.readdirSync(dir).forEach(file => {
|
fs.readdirSync(dir).forEach(file => {
|
||||||
if (fs.statSync(path.join(dir, file)).isDirectory() ) {
|
try {
|
||||||
filelist.push(path.join(dir, file));
|
if (fs.statSync(path.join(dir, file)).isDirectory() ) {
|
||||||
getAllDirs(path.join(dir, file), filelist);
|
filelist.push(path.join(dir, file));
|
||||||
|
getAllDirs(path.join(dir, file), filelist);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
//should we raise an error?
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return filelist;
|
return filelist;
|
||||||
|
Loading…
Reference in New Issue
Block a user