kopia lustrzana https://github.com/c9/core
Have Cloud9 Bundles show up in the plugin manager
rodzic
03ef8db11a
commit
4ec0548696
|
@ -124,9 +124,18 @@ define(function(require, exports, module) {
|
|||
}
|
||||
|
||||
var resourceHolder = new Plugin();
|
||||
// Fetch package.json
|
||||
var resourceVersion = "";
|
||||
|
||||
resourceHolder.freezePublicAPI({
|
||||
get version(){ return resourceVersion },
|
||||
set version(v){ resourceVersion = v; }
|
||||
});
|
||||
|
||||
var inited = false;
|
||||
resourceHolder.on("load", function(){
|
||||
async.parallel([
|
||||
function(next){
|
||||
// Fetch package.json
|
||||
fs.readFile("~/.c9/plugins/" + name + "/package.json", function(err, data){
|
||||
if (err)
|
||||
return next(err);
|
||||
|
@ -163,6 +172,8 @@ define(function(require, exports, module) {
|
|||
|
||||
requirejs.config({paths: pathConfig});
|
||||
|
||||
resourceHolder.version = options.version;
|
||||
|
||||
// Start the installer if one is included
|
||||
if (options.installer) {
|
||||
addStaticPlugin("installer", name, options.installer,
|
||||
|
@ -203,8 +214,15 @@ define(function(require, exports, module) {
|
|||
}
|
||||
], function(err, results){
|
||||
if (err) console.error(err);
|
||||
|
||||
if (!inited) {
|
||||
next();
|
||||
inited = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
resourceHolder.load("Cloud9 Bundle");
|
||||
}
|
||||
|
||||
function finish(){
|
||||
|
@ -260,7 +278,26 @@ define(function(require, exports, module) {
|
|||
|
||||
function addStaticPlugin(type, pluginName, filename, data, plugin) {
|
||||
var services = architect.services;
|
||||
var path = "plugins/" + pluginName + "/" + type + "/" + filename.replace(/\.js$/, "");
|
||||
var path = "plugins/" + pluginName + "/"
|
||||
+ (type == "installer" ? "" : type + "/")
|
||||
+ filename.replace(/\.js$/, "");
|
||||
|
||||
if (!services[plugin.name] && type !== "installer") {
|
||||
services[plugin.name] = plugin;
|
||||
architect.lut["~/.c9/plugins/" + pluginName] = {
|
||||
provides: []
|
||||
};
|
||||
architect.pluginToPackage[plugin.name] = {
|
||||
path: plugin.packagePath,
|
||||
package: pluginName,
|
||||
version: plugin.version,
|
||||
isAdditionalMode: true
|
||||
};
|
||||
if (!architect.packages[pluginName])
|
||||
architect.packages[pluginName] = [];
|
||||
architect.packages[pluginName].push(name);
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case "builders":
|
||||
data = util.safeParseJson(data, function() {});
|
||||
|
|
|
@ -134,6 +134,10 @@ define(function(require, exports, module) {
|
|||
}
|
||||
}), 210, plugin);
|
||||
});
|
||||
|
||||
ext.on("register", function(){
|
||||
reloadModel();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
"type": "git",
|
||||
"url": "http://github.com/c9/newclient.git"
|
||||
},
|
||||
"plugins": {
|
||||
"example": {}
|
||||
},
|
||||
"plugins": {},
|
||||
"installer": "install.js",
|
||||
"categories": [
|
||||
"misc"
|
||||
|
|
Ładowanie…
Reference in New Issue