mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
Use async v2
This commit is contained in:
@@ -161,9 +161,7 @@ var middleware;
|
||||
});
|
||||
|
||||
// Filter out plugins with invalid paths
|
||||
async.filter(paths, file.exists, function (paths) {
|
||||
next(null, paths);
|
||||
});
|
||||
async.filter(paths, file.exists, next);
|
||||
},
|
||||
function (paths, next) {
|
||||
async.map(paths, Plugins.loadPluginInfo, next);
|
||||
@@ -346,7 +344,13 @@ var middleware;
|
||||
|
||||
async.filter(dirs, function (dir, callback) {
|
||||
fs.stat(dir, function (err, stats) {
|
||||
callback(!err && stats.isDirectory());
|
||||
if (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
return callback(null, false);
|
||||
}
|
||||
return callback(err);
|
||||
}
|
||||
callback(null, stats.isDirectory());
|
||||
});
|
||||
}, function (plugins) {
|
||||
next(null, plugins);
|
||||
|
||||
Reference in New Issue
Block a user