tweak c9 publish

pull/85/head
nightwing 2015-04-26 22:18:40 +04:00
rodzic 1043a72bd5
commit f1161fa5de
1 zmienionych plików z 25 dodań i 12 usunięć

Wyświetl plik

@ -466,15 +466,24 @@ define(function(require, exports, module) {
json.version = v.join("."); json.version = v.join(".");
} }
if (!version) return build();
return build();
// Write the package.json file function updatePackageJSON(next) {
var indent = data.match(/{\n\r?^ {4}"/) ? 4 : 2; if (!version)
fs.writeFile(packagePath, JSON.stringify(json, null, indent), function(err){ return next();
if (err) return callback(err);
return build(); // Write the package.json file
}); var indent = data.match(/{\n\r?^ {4}"/) ? 4 : 2;
var newData = JSON.stringify(json, null, indent);
fs.writeFile(cwd + "/.c9/.build/pacage.json", newData, function(err){
if (dryRun)
return next(); // if dry-run is passed only update path in .build
fs.writeFile(packagePath, newData, function(err){
if (err) return callback(err);
return next();
});
});
}
// Build the package // Build the package
// @TODO add a .c9exclude file that excludes files // @TODO add a .c9exclude file that excludes files
@ -702,7 +711,7 @@ define(function(require, exports, module) {
}, },
function(next) { function(next) {
proc.execFile("rm", { proc.execFile("rm", {
args: ["-rf", ".c9build"], args: ["-rf", ".c9/.build"],
cwd: cwd cwd: cwd
}, function() { }, function() {
mkdirP(cwd + "/.c9/.build"); mkdirP(cwd + "/.c9/.build");
@ -712,7 +721,7 @@ define(function(require, exports, module) {
function(next) { function(next) {
var copy = require("architect-build/copy"); var copy = require("architect-build/copy");
var excludeRe = /^\.(gitignore|hgignore|git|c9|hg|c9build)$/; var excludeRe = /^\.(gitignore|hgignore|git|c9|hg)$/;
var excludeMap = Object.create(null); var excludeMap = Object.create(null);
packedFiles.push(cwd + "/__installed__.js"); packedFiles.push(cwd + "/__installed__.js");
@ -729,7 +738,11 @@ define(function(require, exports, module) {
return true; return true;
return false; return false;
} }
}) });
next();
},
updatePackageJSON,
function(next) {
zip(); zip();
} }
]); ]);
@ -1222,7 +1235,7 @@ define(function(require, exports, module) {
force = false; force = false;
}); });
/***** Register and define API *****/ /***** Register and definfe API *****/
/** /**
* *