|
|
@ -1,6 +1,7 @@ |
|
|
|
"use strict"; |
|
|
|
"use strict"; |
|
|
|
|
|
|
|
|
|
|
|
var fs = require('fs'), |
|
|
|
var fs = require('fs'), |
|
|
|
|
|
|
|
_ = require('underscore'), |
|
|
|
builder = require('../lib/builder'), |
|
|
|
builder = require('../lib/builder'), |
|
|
|
settings = require('../settings'); |
|
|
|
settings = require('../settings'); |
|
|
|
|
|
|
|
|
|
|
@ -176,11 +177,15 @@ var getStatusMessageFromRelease = function (app, options, callback) { |
|
|
|
if (report.result === "MBSNotFound") { |
|
|
|
if (report.result === "MBSNotFound") { |
|
|
|
return callback("mbs.json is not found"); |
|
|
|
return callback("mbs.json is not found"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (report.err) { |
|
|
|
if ((report.result.errors.$allMessages || []).length + (report.result.warns.$allMessages || []).length > 0) { |
|
|
|
return callback("ERR: " + report.err); |
|
|
|
return callback(_.map( |
|
|
|
|
|
|
|
report.result.errors.$allMessages || [], function(message) { return "ERR: " + message.message } |
|
|
|
|
|
|
|
).concat(_.map( |
|
|
|
|
|
|
|
report.result.warns.$allMessages || [], function(message) { return "WARN: " + message.message } |
|
|
|
|
|
|
|
)).join("\r\n")); |
|
|
|
} |
|
|
|
} |
|
|
|
if ((report.result.warns.$allMessages || []).length > 0) { |
|
|
|
if (report.err) { |
|
|
|
return callback("WARN: " + report.result.warns.$allMessages[0].message); |
|
|
|
return callback("CRITICAL ERROR: " + report.err); |
|
|
|
} |
|
|
|
} |
|
|
|
if ((report.result.infos.$allMessages || []).length > 0) { |
|
|
|
if ((report.result.infos.$allMessages || []).length > 0) { |
|
|
|
return callback(undefined, report.result.infos.$allMessages[report.result.infos.$allMessages.length-1].message); |
|
|
|
return callback(undefined, report.result.infos.$allMessages[report.result.infos.$allMessages.length-1].message); |
|
|
|