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/14 15:39:20 UTC

[cordova-paramedic] 04/05: lots of logger.info for simulator stuff

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

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

commit c92fb9017d12c0b26ddb5390bed1bc56202975f6
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Sun Apr 14 17:37:16 2019 +0200

    lots of logger.info for simulator stuff
---
 lib/utils/utilities.js | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/lib/utils/utilities.js b/lib/utils/utilities.js
index 39267e4..484aad4 100644
--- a/lib/utils/utilities.js
+++ b/lib/utils/utilities.js
@@ -79,10 +79,28 @@ function getSimulatorModelId (cli, target) {
         return;
     }
 
+    logger.info('found:');
+    logger.info('findSimResult: ' + findSimResult);
+    logger.info('    ' + findSimResult.output);
+    logger.info('    ' + findSimResult.output.split(/\r\n|\r|\n/).length);
+
+    // handling unexpected results
+    if(findSimResult.output.split(/\r\n|\r|\n/).length == 1) {
+        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 findSimResult.output;
 }
 
 function getSimulatorId (findSimResult) {
+    logger.info('getSimulatorId for ' + findSimResult);
+
+
     var split = findSimResult.split(', ');
 
     // Format of the output is "iPhone-6s-Plus, 9.1"
@@ -117,6 +135,8 @@ function getSimulatorId (findSimResult) {
         logger.warn('Multiple matching emulators found. Will use the first matching simulator');
     }
 
+    logger.info('selected simulator ID:    ' + simulatorIds[0]);
+
     return simulatorIds[0];
 }
 


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