kopia lustrzana https://github.com/c9/core
fix c9 publish failing silently
rodzic
6af00b670e
commit
59a7866b8b
2
bin/c9
2
bin/c9
|
@ -6,8 +6,6 @@ var architect = require("architect");
|
|||
// Add ability to load AMD modules
|
||||
require("amd-loader");
|
||||
|
||||
var verbose = process.argv.indexOf("--verbose") + 1
|
||||
|| process.argv.indexOf("-v") + 1;
|
||||
|
||||
architect.resolveConfig(require("../configs/cli.js")(),
|
||||
__dirname + "/../plugins", function (err, config) {
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
module.exports = function(options) {
|
||||
|
||||
// workaround for api difference between node and c9 events modules
|
||||
var EventEmitter = require("events").EventEmitter;
|
||||
var emit_ = EventEmitter.prototype.emit
|
||||
EventEmitter.prototype.emit = function() {
|
||||
emit_.apply(this, arguments);
|
||||
return true;
|
||||
}
|
||||
var EventEmitter = require("../plugins/c9.nodeapi/events").EventEmitter;
|
||||
var Module = require("module");
|
||||
var _resolveFilename_orig = Module._resolveFilename
|
||||
Module._resolveFilename = function(id, parent) {
|
||||
if (id == "events" && parent && /c9.core[\\/]ext\.js/.test(parent.id))
|
||||
id = "../c9.nodeapi/events";
|
||||
return _resolveFilename_orig.call(Module, id, parent);
|
||||
};
|
||||
|
||||
var PID = process.env.C9_PID || 526;
|
||||
var APIHOST = process.env.C9_APIHOST || "api.c9.io"; // "api.c9.io";
|
||||
|
|
|
@ -44,6 +44,7 @@ define(function(require, exports, module) {
|
|||
var force = false;
|
||||
var dryRun = false;
|
||||
var createTag = false;
|
||||
var compress = false;
|
||||
|
||||
// Set up basic auth for api if needed
|
||||
if (BASICAUTH) api.basicAuth = BASICAUTH;
|
||||
|
@ -85,6 +86,11 @@ define(function(require, exports, module) {
|
|||
"alias": "t",
|
||||
"default": false,
|
||||
"boolean": true
|
||||
},
|
||||
"compress" : {
|
||||
"description": "Minify output with uglify.js",
|
||||
"default": true,
|
||||
"boolean": true
|
||||
}
|
||||
},
|
||||
check: function(argv) {
|
||||
|
@ -125,9 +131,17 @@ define(function(require, exports, module) {
|
|||
"alias": "d",
|
||||
"default": false,
|
||||
"boolean": true
|
||||
},
|
||||
"compress" : {
|
||||
"description": "Minify output with uglify.js",
|
||||
"default": false,
|
||||
"boolean": true
|
||||
}
|
||||
},
|
||||
exec: function(argv) {
|
||||
compress = argv["compress"];
|
||||
verbose = argv["verbose"];
|
||||
force = argv["force"];
|
||||
if (argv["devel"]) {
|
||||
var code = function(argument) {
|
||||
/* TODO explain */
|
||||
|
@ -159,13 +173,14 @@ define(function(require, exports, module) {
|
|||
}
|
||||
else {
|
||||
dryRun = true;
|
||||
publish({local: true}, function(err){
|
||||
publish({local: true}, function(err, result){
|
||||
if (err) {
|
||||
console.error(err);
|
||||
if (!verbose)
|
||||
console.error("\nTry running with --verbose flag for more information");
|
||||
process.exit(1);
|
||||
}
|
||||
console.log("Done!");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -186,6 +201,7 @@ define(function(require, exports, module) {
|
|||
check: function(argv) {},
|
||||
exec: function(argv) {
|
||||
verbose = argv["verbose"];
|
||||
compress = argv["compress"];
|
||||
|
||||
unpublish(
|
||||
function(err, data){
|
||||
|
@ -574,7 +590,7 @@ define(function(require, exports, module) {
|
|||
enableBrowser: true,
|
||||
includeConfig: false,
|
||||
noArchitect: true,
|
||||
compress: !dryRun,
|
||||
compress: compress,
|
||||
obfuscate: true,
|
||||
oneLine: true,
|
||||
filter: [],
|
||||
|
|
Ładowanie…
Reference in New Issue