This is an automated email from the ASF dual-hosted git repository.
alsorokin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git
The following commit(s) were added to refs/heads/master by this push:
new 31155df Properly handle failed build
31155df is described below
commit 31155dfd9287e9c53b034bc00dba4473f7c9bf5c
Author: Alexander Sorokin <[email protected]>
AuthorDate: Fri Jan 26 14:47:21 2018 +0300
Properly handle failed build
---
lib/appium/AppiumRunner.js | 4 ++--
lib/paramedic.js | 8 ++++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/appium/AppiumRunner.js b/lib/appium/AppiumRunner.js
index 1204cb0..4556a2a 100644
--- a/lib/appium/AppiumRunner.js
+++ b/lib/appium/AppiumRunner.js
@@ -382,8 +382,8 @@ AppiumRunner.prototype.prepareApp = function () {
// rebuild the app
logger.normal('paramedic-appium: Building the app...');
- child_process.exec(buildCommand, { cwd: fullAppPath, maxBuffer:
SMALL_BUFFER_SIZE }, function (error) {
- if (error) {
+ child_process.exec(buildCommand, { cwd: fullAppPath, maxBuffer:
SMALL_BUFFER_SIZE }, function (error, stdout, stderr) {
+ if (error || stdout.indexOf('BUILD FAILED') >= 0 ||
stderr.indexOf('BUILD FAILED') >= 0) {
d.reject('Couldn\'t build the app: ' + error);
} else {
global.PACKAGE_PATH = getPackagePath(self.options);
diff --git a/lib/paramedic.js b/lib/paramedic.js
index 41a12b3..a494719 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -282,13 +282,17 @@ ParamedicRunner.prototype.buildApp = function () {
logger.normal('cordova-paramedic: running command ' + command);
return execPromise(command)
- .fail(function(output) {
+ .then(function(output) {
+ if (output.indexOf ('BUILD FAILED') >= 0) {
+ throw new Error('Unable to build the project.');
+ }
+ }, function(output) {
// this trace is automatically available in verbose mode
// so we check for this flag to not trace twice
if (!self.config.verbose) {
logger.normal(output);
}
- throw new Error('Unable to build project.');
+ throw new Error('Unable to build the project.');
});
};
--
To stop receiving notification emails like this one, please contact
[email protected].
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]