Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9EC89200BAA for ; Thu, 27 Oct 2016 09:45:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9D6AE160AF6; Thu, 27 Oct 2016 07:45:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E8694160AE4 for ; Thu, 27 Oct 2016 09:45:44 +0200 (CEST) Received: (qmail 50742 invoked by uid 500); 27 Oct 2016 07:45:44 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 50728 invoked by uid 99); 27 Oct 2016 07:45:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2016 07:45:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B249DE00DB; Thu, 27 Oct 2016 07:45:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alsorokin@apache.org To: commits@cordova.apache.org Message-Id: <19dd49d1463a42d7b98f8f4feb3e8af0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cordova-paramedic git commit: CB-12066 Async platform add and requirements check Date: Thu, 27 Oct 2016 07:45:43 +0000 (UTC) archived-at: Thu, 27 Oct 2016 07:45:45 -0000 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 Authored: Tue Oct 25 18:45:41 2016 +0300 Committer: Alexander Sorokin 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