kopia lustrzana https://github.com/c9/core
c9 install now runs installation locally and installer as well
Conflicts: plugins/c9.profile.page.packages/components/PackagePage.js plugins/c9.profile.page.packages/jsx/PackagePage.jsxpull/85/head
rodzic
26ad32975e
commit
7820745c7c
|
@ -65,11 +65,28 @@ return [
|
||||||
packagePath: "./c9.cli.open/restart",
|
packagePath: "./c9.cli.open/restart",
|
||||||
platform: process.platform
|
platform: process.platform
|
||||||
},
|
},
|
||||||
|
"./c9.automate/automate",
|
||||||
|
"./c9.ide.installer/commands/centos",
|
||||||
|
"./c9.ide.installer/commands/bash",
|
||||||
|
"./c9.ide.installer/commands/npm",
|
||||||
|
"./c9.ide.installer/commands/symlink",
|
||||||
|
{
|
||||||
|
packagePath: "./c9.ide.installer/commands/tar.gz",
|
||||||
|
bashBin: "bash"
|
||||||
|
},
|
||||||
|
"./c9.ide.installer/commands/ubuntu",
|
||||||
|
"./c9.ide.installer/cli",
|
||||||
|
{
|
||||||
|
packagePath: "./c9.ide.installer/installer",
|
||||||
|
homeDir: process.env.HOME,
|
||||||
|
installSelfCheck: false,
|
||||||
|
installPath: process.env.HOME + "/.c9"
|
||||||
|
},
|
||||||
// "./c9.cli.sync/sync",
|
// "./c9.cli.sync/sync",
|
||||||
//"./c9.ide.keys/commands",
|
//"./c9.ide.keys/commands",
|
||||||
{
|
{
|
||||||
consumes: [],
|
consumes: [],
|
||||||
provides: ["settings", "workspace", "cli_commands", "c9"],
|
provides: ["settings", "workspace", "cli_commands", "c9", "error_handler"],
|
||||||
setup: function(options, imports, register) {
|
setup: function(options, imports, register) {
|
||||||
register(null, {
|
register(null, {
|
||||||
// @todo share with ace min
|
// @todo share with ace min
|
||||||
|
@ -80,6 +97,9 @@ return [
|
||||||
local: true,
|
local: true,
|
||||||
setStatus: function(){}
|
setStatus: function(){}
|
||||||
},
|
},
|
||||||
|
error_handler: {
|
||||||
|
log: function(){}
|
||||||
|
},
|
||||||
workspace: (function(){
|
workspace: (function(){
|
||||||
var ws = new EventEmitter();
|
var ws = new EventEmitter();
|
||||||
ws.connect = function(name, callback) {
|
ws.connect = function(name, callback) {
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
"c9.ide.help.support": "#60e88f5680",
|
"c9.ide.help.support": "#60e88f5680",
|
||||||
"c9.ide.imgeditor": "#08bbc53578",
|
"c9.ide.imgeditor": "#08bbc53578",
|
||||||
"c9.ide.immediate": "#6845a93705",
|
"c9.ide.immediate": "#6845a93705",
|
||||||
"c9.ide.installer": "#f8f0d11bff",
|
"c9.ide.installer": "#13d1bd28e4",
|
||||||
"c9.ide.mount": "#32e79866ee",
|
"c9.ide.mount": "#32e79866ee",
|
||||||
"c9.ide.navigate": "#64156c7f4a",
|
"c9.ide.navigate": "#64156c7f4a",
|
||||||
"c9.ide.newresource": "#f1f0624768",
|
"c9.ide.newresource": "#f1f0624768",
|
||||||
|
|
|
@ -118,7 +118,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
cmd.addCommand({
|
cmd.addCommand({
|
||||||
name: "build",
|
name: "build",
|
||||||
info: " Builds development version of package to load in non-debug mode.",
|
info: " Builds development version of package to load in non-debug mode.",
|
||||||
usage: "[--devel]",
|
usage: "[--devel]",
|
||||||
options: {
|
options: {
|
||||||
"devel" : {
|
"devel" : {
|
||||||
|
@ -1130,12 +1130,42 @@ define(function(require, exports, module) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
console.log("Notifying c9.io that packages needs to be installed");
|
console.log("Notifying c9.io that packages needs to be installed");
|
||||||
|
|
||||||
var endpoint = options.global ? api.user : api.project;
|
// Install Locally
|
||||||
var url = "install/" + packageName + "/" + version;
|
options.local = true;
|
||||||
|
install(name + "@" + version, options, function(err){
|
||||||
endpoint.post(url, function(err, info){
|
if (err) return callback(err);
|
||||||
callback(err, info);
|
|
||||||
|
var path = "~/.c9/plugins/" + name;
|
||||||
|
fs.readFile(path + "/package.json", "utf8", function(err, data){
|
||||||
|
if (err) return callback(new Error("Package.json not found in " + path));
|
||||||
|
|
||||||
|
var installPath;
|
||||||
|
try { installPath = JSON.parse(data).installer; }
|
||||||
|
catch(e){
|
||||||
|
return callback(new Error("Could not parse package.json in " + path));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (installPath) {
|
||||||
|
installer.createSession(name, version, require(path + "/" + installPath), function(err){
|
||||||
|
if (err) return callback(new Error("Error Installing Package " + name + "@" + version));
|
||||||
|
installToDatabase();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
installToDatabase();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function installToDatabase(){
|
||||||
|
var endpoint = options.global ? api.user : api.project;
|
||||||
|
var url = "install/" + packageName + "/" + version + "?silent=1";
|
||||||
|
|
||||||
|
endpoint.post(url, function(err, info){
|
||||||
|
callback(err, info);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue