Skip to content

Commit

Permalink
Replace statSync call with an async call
Browse files Browse the repository at this point in the history
  • Loading branch information
drudge committed Nov 2, 2015
1 parent 2bdd861 commit 83d0b01
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ exports.files = function files(dir, type, callback, /* used internally */ ignore
type = 'file';
}

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

fs.readdir(dir, function(err, list) {
if (err) return callback(err);
pending = list.length;
Expand All @@ -73,9 +76,7 @@ exports.files = function files(dir, type, callback, /* used internally */ ignore
fs.stat(file, getStatHandler(file));
}
});
} else {
return done();
}
});
};


Expand Down

0 comments on commit 83d0b01

Please sign in to comment.