From 97c5f6009ddfcdbaf0ad2438b814836b7fb6337e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sat, 26 Oct 2013 18:26:30 -0400 Subject: [PATCH] closes #455 --- src/plugins.js | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/plugins.js b/src/plugins.js index c887c13185..51e45716b7 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -232,32 +232,13 @@ var fs = require('fs'), }); }, showInstalled: function(callback) { - // TODO: Also check /node_modules var _self = this; - localPluginPath = path.join(__dirname, '../plugins'), npmPluginPath = path.join(__dirname, '../node_modules'); async.waterfall([ function(next) { - async.parallel([ - function(next) { - fs.readdir(localPluginPath, next); - }, - function(next) { - fs.readdir(npmPluginPath, next); - } - ], function(err, dirs) { - if (err) return next(err); - - dirs[0] = dirs[0].map(function(file) { - return path.join(localPluginPath, file); - }).filter(function(file) { - var stats = fs.statSync(file); - if (stats.isDirectory()) return true; - else return false; - }); - - dirs[1] = dirs[1].map(function(file) { + fs.readdir(npmPluginPath, function(err, dirs) { + dirs = dirs.map(function(file) { return path.join(npmPluginPath, file); }).filter(function(file) { var stats = fs.statSync(file); @@ -265,7 +246,7 @@ var fs = require('fs'), else return false; }); - next(err, dirs[0].concat(dirs[1])); + next(err, dirs); }); }, function(files, next) {