You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by al...@apache.org on 2016/10/27 07:45:43 UTC

cordova-paramedic git commit: CB-12066 Async platform add and requirements check

Repository: cordova-paramedic
Updated Branches:
  refs/heads/master f2d0b9d08 -> 39e3bc86d


CB-12066 Async platform add and requirements check


Project: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/commit/39e3bc86
Tree: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/tree/39e3bc86
Diff: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/diff/39e3bc86

Branch: refs/heads/master
Commit: 39e3bc86d932a7b55db8cd0052215340100c1770
Parents: f2d0b9d
Author: Alexander Sorokin <al...@akvelon.com>
Authored: Tue Oct 25 18:45:41 2016 +0300
Committer: Alexander Sorokin <al...@akvelon.com>
Committed: Thu Oct 27 10:44:31 2016 +0300

----------------------------------------------------------------------
 lib/paramedic.js | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/39e3bc86/lib/paramedic.js
----------------------------------------------------------------------
diff --git a/lib/paramedic.js b/lib/paramedic.js
index 2d56080..51fbc29 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -73,7 +73,9 @@ ParamedicRunner.prototype.run = function () {
     return Q().then(function () {
         self.createTempProject();
         shell.pushd(self.tempFolder.name);
-        self.prepareProjectToRunTests();
+        return self.prepareProjectToRunTests();
+    })
+    .then(function () {
         if (self.config.runMainTests()) {
             return Server.startServer(self.config.getPorts(), self.config.getExternalServerUrl(), self.config.getUseTunnel());
         }
@@ -116,10 +118,14 @@ ParamedicRunner.prototype.createTempProject = function () {
 };
 
 ParamedicRunner.prototype.prepareProjectToRunTests = function () {
+    var self = this;
+
     this.installPlugins();
     this.setUpStartPage();
-    this.installPlatform();
-    this.checkPlatformRequirements();
+    return this.installPlatform()
+    .then(function () {
+        return self.checkPlatformRequirements();
+    });
 };
 
 ParamedicRunner.prototype.installPlugins = function () {
@@ -151,16 +157,23 @@ ParamedicRunner.prototype.setUpStartPage = function () {
 };
 
 ParamedicRunner.prototype.installPlatform = function () {
-    logger.info('cordova-paramedic: adding platform : ' + this.config.getPlatform());
-    exec('cordova platform add ' + this.config.getPlatform());
+    var platform = this.config.getPlatform();
+    logger.info('cordova-paramedic: adding platform ' + platform);
+
+    return execPromise('cordova platform add ' + platform)
+    .then(function () {
+        logger.info('cordova-paramedic: successfully finished adding platform ' + platform);
+    });
 };
 
 ParamedicRunner.prototype.checkPlatformRequirements = function () {
-    logger.normal('cordova-paramedic: checking requirements for platform ' + this.config.getPlatformId());
-    var result = exec('cordova requirements ' + this.config.getPlatformId());
+    var platformId = this.config.getPlatformId();
 
-    if (result.code !== 0)
-        throw new Error('Platform requirements check has failed!');
+    logger.normal('cordova-paramedic: checking requirements for platform ' + platformId);
+    return execPromise('cordova requirements ' + platformId)
+    .then(function () {
+        logger.info('cordova-paramedic: successfully finished checking requirements for platform ' + platformId);
+    });
 };
 
 ParamedicRunner.prototype.setPermissions = function () {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org