You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2019/04/12 19:52:14 UTC

[cordova-paramedic] branch janpio-xcode10.1 updated: handle empty simulator result

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-xcode10.1
in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git


The following commit(s) were added to refs/heads/janpio-xcode10.1 by this push:
     new 5089420  handle empty simulator result
5089420 is described below

commit 50894203989755862f851676495d7a21cfdb6a0f
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Fri Apr 12 21:51:59 2019 +0200

    handle empty simulator result
---
 lib/utils/utilities.js | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/lib/utils/utilities.js b/lib/utils/utilities.js
index adba20f..0e10132 100644
--- a/lib/utils/utilities.js
+++ b/lib/utils/utilities.js
@@ -62,11 +62,6 @@ function getSimulatorsFolder() {
 }
 
 function getSimulatorModelId(cli, target) {
-    var bla = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS;
-    logger.info('running:');
-    logger.info('    ' + bla);
-    var foo = exec(bla);
-
     var findSimCommand;
     if (target) {
         findSimCommand = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS + ' | grep ' + target + ' | tail -n1';
@@ -84,6 +79,20 @@ function getSimulatorModelId(cli, target) {
         return;
     }
 
+    logger.info('found:');
+    logger.info('    ' + findSimCommand.output.split(/\r\n|\r|\n/).length);
+
+    if(findSimCommand.output.split(/\r\n|\r|\n/).length == 0) {
+        logger.error('Could not find an appropriate simulator.');
+
+        var unfilteredFindSimCommand = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS;
+        logger.info('running:');
+        logger.info('    ' + unfilteredFindSimCommand);
+        exec(unfilteredFindSimCommand);
+
+        return;
+    }
+
     return findSimResult.output;
 }
 


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