Merge pull request +7153 from c9/fix/sfdc-installer

Install SFDC plugin dependencies
pull/117/head
Harutyun Amirjanyan 2015-05-05 20:51:39 +04:00
commit 787182b0aa
2 zmienionych plików z 25 dodań i 6 usunięć

Wyświetl plik

@ -351,7 +351,11 @@ define(function(require, exports, module) {
// Untargz package
proc.spawn(TAR, {
args: ["-C", normalizePath(packagePath), "-zxvf", normalizePath(gzPath)]
args: [
(verbose ? "-v" : ""),
"-C", normalizePath(packagePath),
"-zxf", normalizePath(gzPath)
]
}, function(err, p){
if (err) return callback(err);

Wyświetl plik

@ -85,9 +85,12 @@ define(function(require, exports, module) {
var found = {}, packages = [];
config.forEach(function(item){
if (!found[item.name])
found[item.name] = true;
else return;
if (typeof item === "string") {
item = { name: item, version: null };
}
if (found[item.name]) return;
found[item.name] = true;
packages.push({ name: item.name, version: item.version });
});
@ -110,9 +113,21 @@ define(function(require, exports, module) {
function installPlugin(name, version, callback){
// Headless installation of the plugin
installer.createSession(name, version, function(session, options){
var cmd = [
"c9",
"install",
"--local",
"--force",
"--accessToken=" + auth.accessToken,
];
if (version == null)
cmd.push(escapeShell(name));
else
cmd.push(escapeShell(name + "@" + version));
session.install({
"bash": "c9 install --local --force --accessToken=" + auth.accessToken
+ " " + escapeShell(name) + "@" + escapeShell(version)
"bash": cmd.join(" ")
});
// Force to start immediately