Make plugins dict non-recursive

pull/528/head
Egil Moeller 2012-02-25 19:43:22 +01:00
parent e542199aab
commit ce35f20988
1 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ var path = require("path");
var async = require("async"); var async = require("async");
var fs = require("fs"); var fs = require("fs");
var tsort = require("./tsort"); var tsort = require("./tsort");
var util = require("util");
exports.prefix = 'pluginomatic_'; exports.prefix = 'pluginomatic_';
exports.loaded = false; exports.loaded = false;
@ -65,6 +66,7 @@ exports.getPlugins = function (cb) {
function (err) { function (err) {
parts = exports.sortParts(parts); parts = exports.sortParts(parts);
var hooks = exports.extractHooks(parts); var hooks = exports.extractHooks(parts);
// console.log(util.inspect(plugins, undefined, null));
cb(err, plugins, parts, hooks); cb(err, plugins, parts, hooks);
} }
); );
@ -118,7 +120,7 @@ exports.loadPlugin = function (packages, plugin_name, plugins, parts, cb) {
plugin.package = packages[plugin_name]; plugin.package = packages[plugin_name];
plugins[plugin_name] = plugin; plugins[plugin_name] = plugin;
plugin.parts.forEach(function (part) { plugin.parts.forEach(function (part) {
part.plugin = plugin; part.plugin = plugin_name;
part.full_name = plugin_name + "/" + part.name; part.full_name = plugin_name + "/" + part.name;
parts[part.full_name] = part; parts[part.full_name] = part;
}); });