Skip to content

Commit

Permalink
And return absolute paths in listDirectories
Browse files Browse the repository at this point in the history
Doh
  • Loading branch information
FredrikNoren committed Sep 9, 2013
1 parent 778a78a commit 21a7832
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ app.get('/api/fs/listDirectories', function(req, res) {
winston.error(err.stack);
res.json(400, err);
} else {
async.filter(files, function(file, callback) {
absolutePath = path.join(dir, file);
var absolutePaths = files.map(function(file) {
return path.join(dir, file);
});
async.filter(absolutePaths, function(absolutePath, callback) {
fs.stat(absolutePath, function(err, stat) {
callback(!err && stat && stat.isDirectory());
});
Expand Down

0 comments on commit 21a7832

Please sign in to comment.