forked from tungstenfabric/tf-webui-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode-dir_0.1.5.patch
46 lines (45 loc) · 2.04 KB
/
node-dir_0.1.5.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- old/node_modules/node-dir/lib/readfiles.js 2014-07-15 22:08:05.000000000 +0530
+++ new/node_modules/node-dir/lib/readfiles.js 2014-07-16 13:49:06.000000000 +0530
@@ -66,13 +66,21 @@
if (!filename) return done(null, files);
var file = path.join(dir, filename);
fs.stat(file, function(err, stat) {
- if (err) return done(err);
+ if (err) {
+ next();
+ return;
+ }
+ //if (err) return done(err);
if (stat && stat.isDirectory()) {
if (options.recursive) {
if (options.matchDir && !options.matchDir.test(filename)) return next();
if (options.excludeDir && options.excludeDir.test(filename)) return next();
readFiles(file, options, callback, function(err, sfiles) {
- if (err) return done(err);
+ if (err) {
+ next();
+ return;
+ }
+ //if (err) return done(err);
files = files.concat(sfiles);
next();
});
@@ -84,7 +92,11 @@
if (options.shortName) files.push(filename);
else files.push(file);
fs.readFile(file, options.encoding, function(err, data) {
- if (err) return done(err);
+ //if (err) return done(err);
+ if (err) {
+ next();
+ return;
+ }
if (callback.length > 3)
if (options.shortName) callback(null, data, filename, next);
else callback(null, data, file, next);
@@ -96,4 +108,4 @@
});
}
-module.exports = readFiles;
\ No newline at end of file
+module.exports = readFiles;