pull/85/head
nightwing 2015-04-25 02:15:25 +04:00
rodzic c9f66f2c88
commit ad38f83962
1 zmienionych plików z 10 dodań i 8 usunięć

Wyświetl plik

@ -467,11 +467,14 @@ define(function(require, exports, module) {
if (dryRun) return build(); if (dryRun) return build();
commit();
});
function commit() {
SHELLSCRIPT = SHELLSCRIPT SHELLSCRIPT = SHELLSCRIPT
.replace(/\$1/, packagePath) .replace(/\$1/, packagePath)
.replace(/\$2/, json.version); .replace(/\$2/, json.version);
// commit
proc.spawn("bash", { proc.spawn("bash", {
args: ["-c", SHELLSCRIPT] args: ["-c", SHELLSCRIPT]
}, function(err, p){ }, function(err, p){
@ -495,10 +498,9 @@ define(function(require, exports, module) {
build(); build();
}); });
}); });
}); }
// Build the package // Build the package
// @TODO use a proper package tool
// @TODO add a .c9exclude file that excludes files // @TODO add a .c9exclude file that excludes files
var zipFilePath; var zipFilePath;
function build(){ function build(){
@ -727,8 +729,8 @@ define(function(require, exports, module) {
args: ["-rf", ".c9build"], args: ["-rf", ".c9build"],
cwd: cwd cwd: cwd
}, function() { }, function() {
mkdirP(cwd + "/.c9build"); mkdirP(cwd + "/.c9/.build");
fs.writeFile(cwd + "/.c9build/__installed__.js", result.code, "utf8", next); fs.writeFile(cwd + "/.c9/.build/__installed__.js", result.code, "utf8", next);
}); });
}, },
function(next) { function(next) {
@ -742,7 +744,7 @@ define(function(require, exports, module) {
p = "/" + normalizePath(Path.relative(cwd, p)); p = "/" + normalizePath(Path.relative(cwd, p));
excludeMap[p] = 1; excludeMap[p] = 1;
}); });
copy(cwd, cwd + "/.c9build", { copy(cwd, cwd + "/.c9/.build", {
exclude: function(name, parent) { exclude: function(name, parent) {
if (excludeRe.test(name)) if (excludeRe.test(name))
return true; return true;
@ -769,7 +771,7 @@ define(function(require, exports, module) {
tarArgs.push("."); tarArgs.push(".");
proc.spawn(TAR, { proc.spawn(TAR, {
args: tarArgs, args: tarArgs,
cwd: cwd + "/.c9build" cwd: cwd + "/.c9/.build"
}, function(err, p){ }, function(err, p){
if (err) return callback(err); if (err) return callback(err);