diff --git a/configs/cli.js b/configs/cli.js index fef801e9..b7a89147 100644 --- a/configs/cli.js +++ b/configs/cli.js @@ -65,11 +65,28 @@ return [ packagePath: "./c9.cli.open/restart", 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.ide.keys/commands", { consumes: [], - provides: ["settings", "workspace", "cli_commands", "c9"], + provides: ["settings", "workspace", "cli_commands", "c9", "error_handler"], setup: function(options, imports, register) { register(null, { // @todo share with ace min @@ -80,6 +97,9 @@ return [ local: true, setStatus: function(){} }, + error_handler: { + log: function(){} + }, workspace: (function(){ var ws = new EventEmitter(); ws.connect = function(name, callback) { diff --git a/package.json b/package.json index 63f31c24..723e5a1a 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "c9.ide.help.support": "#60e88f5680", "c9.ide.imgeditor": "#08bbc53578", "c9.ide.immediate": "#6845a93705", - "c9.ide.installer": "#f8f0d11bff", + "c9.ide.installer": "#13d1bd28e4", "c9.ide.mount": "#32e79866ee", "c9.ide.navigate": "#64156c7f4a", "c9.ide.newresource": "#f1f0624768", diff --git a/plugins/c9.cli.publish/publish.js b/plugins/c9.cli.publish/publish.js index 7f76ab70..fc1caa5c 100644 --- a/plugins/c9.cli.publish/publish.js +++ b/plugins/c9.cli.publish/publish.js @@ -118,7 +118,7 @@ define(function(require, exports, module) { cmd.addCommand({ 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]", options: { "devel" : { @@ -1130,12 +1130,42 @@ define(function(require, exports, module) { if (verbose) console.log("Notifying c9.io that packages needs to be installed"); - var endpoint = options.global ? api.user : api.project; - var url = "install/" + packageName + "/" + version; - - endpoint.post(url, function(err, info){ - callback(err, info); + // Install Locally + options.local = true; + install(name + "@" + version, options, function(err){ + if (err) return callback(err); + + 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); + }); + } }); + } } }