kopia lustrzana https://github.com/c9/core
add installer to bundle
rodzic
60c9d3450c
commit
ac7410a728
|
@ -551,6 +551,14 @@ define(function(require, exports, module) {
|
|||
});
|
||||
}
|
||||
|
||||
if (json.installer) {
|
||||
extraCode.push({
|
||||
type: "installer",
|
||||
filename: json.installer.main,
|
||||
data: json.installer.version
|
||||
});
|
||||
}
|
||||
|
||||
if (!extraCode.length)
|
||||
return next();
|
||||
|
||||
|
@ -602,7 +610,6 @@ define(function(require, exports, module) {
|
|||
var additional = [];
|
||||
var packedConfig = config.slice();
|
||||
if (staticPlugin) {
|
||||
console.log(packedConfig)
|
||||
additional.push(staticPlugin);
|
||||
packedConfig.push(staticPlugin.id);
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ define(function(require, exports, module) {
|
|||
return;
|
||||
}
|
||||
|
||||
var resourceHolder = new Plugin();
|
||||
// Fetch package.json
|
||||
async.parallel([
|
||||
function(next){
|
||||
|
@ -142,17 +143,6 @@ define(function(require, exports, module) {
|
|||
var host = vfs.baseUrl + "/";
|
||||
var base = join(String(c9.projectId),
|
||||
"plugins", auth.accessToken);
|
||||
|
||||
// Start the installer if one is included
|
||||
if (options.installer) {
|
||||
var version = options.installer.version;
|
||||
var url = host + join(base, name, options.installer.main);
|
||||
installer.createVersion(name, version, function(v, o){
|
||||
require([url], function(fn){
|
||||
fn(v, o);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var pathConfig = {};
|
||||
|
||||
|
@ -173,6 +163,12 @@ define(function(require, exports, module) {
|
|||
|
||||
requirejs.config({paths: pathConfig});
|
||||
|
||||
// Start the installer if one is included
|
||||
if (options.installer) {
|
||||
addStaticPlugin("installer", name, options.installer.main,
|
||||
options.installer.version, resourceHolder);
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
},
|
||||
|
@ -191,7 +187,7 @@ define(function(require, exports, module) {
|
|||
data = data.replace(rePath, "");
|
||||
|
||||
// Process all the submodules
|
||||
var parallel = processModules(path, data);
|
||||
var parallel = processModules(path, data, resourceHolder);
|
||||
async.parallel(parallel, function(err, data){
|
||||
if (err)
|
||||
return next(err);
|
||||
|
@ -228,11 +224,9 @@ define(function(require, exports, module) {
|
|||
list.forEach(next);
|
||||
}
|
||||
|
||||
function processModules(path, data){
|
||||
function processModules(path, data, plugin){
|
||||
var parallel = [];
|
||||
|
||||
var placeholder = new Plugin();
|
||||
|
||||
data.split("\n").forEach(function(line){
|
||||
if (!line.match(reParts)) return;
|
||||
|
||||
|
@ -250,7 +244,7 @@ define(function(require, exports, module) {
|
|||
return next(err);
|
||||
}
|
||||
|
||||
addStaticPlugin(type, path, filename, data, placeholder);
|
||||
addStaticPlugin(type, path, filename, data, plugin);
|
||||
|
||||
next();
|
||||
});
|
||||
|
@ -312,6 +306,12 @@ define(function(require, exports, module) {
|
|||
case "templates":
|
||||
services.newresource.addFileTemplate(data, plugin);
|
||||
break;
|
||||
case "installer":
|
||||
installer.createSession(pluginName, data, function(v, o){
|
||||
require([path], function(fn){
|
||||
fn(v, o);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
define(function(require, exports, module) {
|
||||
|
||||
module.exports = function(session, options){
|
||||
// Dependencies for the collaboration features of Cloud9
|
||||
|
||||
session.install({
|
||||
"name": "SQLite",
|
||||
"description": "SQLite Database and NPM module",
|
||||
"cwd": "~/.c9",
|
||||
"optional": true
|
||||
}, [
|
||||
{
|
||||
"npm": ["sqlite3@2.1.18"]
|
||||
},
|
||||
{
|
||||
"tar.gz": {
|
||||
"url": "https://raw.githubusercontent.com/c9/install/master/packages/sqlite3/linux/sqlite3.tar.gz",
|
||||
"target": "~/.c9/lib/sqlite3",
|
||||
"dir": "sqlite3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"symlink": {
|
||||
"source": "~/.c9/lib/sqlite3/sqlite3",
|
||||
"target": "~/.c9/bin/sqlite3"
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
session.install({
|
||||
"name": "Sequalize",
|
||||
"description": "Sequalize NPM module",
|
||||
"cwd": "~/.c9",
|
||||
"optional": true
|
||||
}, {
|
||||
"npm": ["sequelize@2.0.0-beta.0"]
|
||||
});
|
||||
|
||||
session.install({
|
||||
"name": "Collab Server",
|
||||
"description": "A small Node.js collaboration server",
|
||||
"cwd": "~/.c9",
|
||||
"optional": true
|
||||
}, {
|
||||
"tar.gz": {
|
||||
"url": "https://raw.githubusercontent.com/c9/install/master/packages/extend/c9-vfs-extend.tar.gz",
|
||||
"target": "~/.c9"
|
||||
}
|
||||
});
|
||||
|
||||
// Show the installation screen
|
||||
session.start();
|
||||
};
|
||||
|
||||
module.exports.version = 1;
|
||||
|
||||
});
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "c9.ide.example3",
|
||||
"description": "Cloud9 Custom Example Plguin",
|
||||
"version": "1.3.0",
|
||||
"author": "Ajax.org B.V. <info@ajax.org>",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Ruben Daniels",
|
||||
"email": "ruben@c9.io"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/c9/newclient.git"
|
||||
},
|
||||
"plugins": {
|
||||
"example": {}
|
||||
},
|
||||
"installer": {
|
||||
"main": "install.js",
|
||||
"version": 1
|
||||
},
|
||||
"categories": [
|
||||
"misc"
|
||||
],
|
||||
"licenses": []
|
||||
}
|
Ładowanie…
Reference in New Issue