Added a fake plugin __builtin__ for builtin functionality

This commit is contained in:
Egil Moeller 2012-02-24 20:21:52 +01:00
parent 441fd2f8eb
commit ee40b23cfc
2 changed files with 12 additions and 1 deletions

View File

@ -32,6 +32,10 @@ exports.update = function (cb) {
exports.getPlugins = function (cb) {
exports.getPackages(function (er, packages) {
packages.__builtin__ = {
"path": path.resolve(npm.dir, "../..")
};
var parts = {};
var plugins = {};
// Load plugin metadata pluginomatic.json
@ -83,8 +87,9 @@ exports.extractHooks = function (parts) {
}
exports.loadPlugin = function (packages, plugin_name, plugins, parts, cb) {
var plugin_path = path.resolve(packages[plugin_name].path, "pluginomatic.json");
fs.readFile(
path.resolve(packages[plugin_name].path, "pluginomatic.json"),
plugin_path,
function (er, data) {
var plugin = JSON.parse(data);
plugin.package = packages[plugin_name];

6
pluginomatic.json Normal file
View File

@ -0,0 +1,6 @@
{
"parts": [{
"name": "__builtin__",
"hooks": {}
}]
}