From ad38f83962c9588dd68eb2449b27040a1324759a Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 25 Apr 2015 02:15:25 +0400 Subject: [PATCH] cleanup --- plugins/c9.cli.publish/publish.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/c9.cli.publish/publish.js b/plugins/c9.cli.publish/publish.js index dea177fe..245b78a6 100644 --- a/plugins/c9.cli.publish/publish.js +++ b/plugins/c9.cli.publish/publish.js @@ -467,11 +467,14 @@ define(function(require, exports, module) { if (dryRun) return build(); + commit(); + }); + + function commit() { SHELLSCRIPT = SHELLSCRIPT .replace(/\$1/, packagePath) .replace(/\$2/, json.version); - - // commit + proc.spawn("bash", { args: ["-c", SHELLSCRIPT] }, function(err, p){ @@ -495,10 +498,9 @@ define(function(require, exports, module) { build(); }); }); - }); + } // Build the package - // @TODO use a proper package tool // @TODO add a .c9exclude file that excludes files var zipFilePath; function build(){ @@ -727,8 +729,8 @@ define(function(require, exports, module) { args: ["-rf", ".c9build"], cwd: cwd }, function() { - mkdirP(cwd + "/.c9build"); - fs.writeFile(cwd + "/.c9build/__installed__.js", result.code, "utf8", next); + mkdirP(cwd + "/.c9/.build"); + fs.writeFile(cwd + "/.c9/.build/__installed__.js", result.code, "utf8", next); }); }, function(next) { @@ -742,7 +744,7 @@ define(function(require, exports, module) { p = "/" + normalizePath(Path.relative(cwd, p)); excludeMap[p] = 1; }); - copy(cwd, cwd + "/.c9build", { + copy(cwd, cwd + "/.c9/.build", { exclude: function(name, parent) { if (excludeRe.test(name)) return true; @@ -769,7 +771,7 @@ define(function(require, exports, module) { tarArgs.push("."); proc.spawn(TAR, { args: tarArgs, - cwd: cwd + "/.c9build" + cwd: cwd + "/.c9/.build" }, function(err, p){ if (err) return callback(err);