Skip to content

Commit

Permalink
Merge pull request #33 from propertyguru/master
Browse files Browse the repository at this point in the history
Replaced .stat with .lstat in order to support broken symlinks
  • Loading branch information
fshost authored Jul 9, 2016
2 parents 327f43f + db1e0e0 commit a676073
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ exports.files = function files(dir, type, callback, /* used internally */ ignore
type = 'file';
}

fs.stat(dir, function(err, stat) {
fs.lstat(dir, function(err, stat) {
if (err) return callback(err);
if(stat && stat.mode === 17115) return done();

Expand All @@ -73,7 +73,7 @@ exports.files = function files(dir, type, callback, /* used internally */ ignore
if (!pending) return done();
for (var file, i = 0, l = list.length; i < l; i++) {
file = path.join(dir, list[i]);
fs.stat(file, getStatHandler(file));
fs.lstat(file, getStatHandler(file));
}
});
});
Expand Down

0 comments on commit a676073

Please sign in to comment.