cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [2/3] ios commit: CB-8855 Fix display ios devices with --list (closes #137)
Date Mon, 20 Apr 2015 23:34:03 GMT
CB-8855 Fix display ios devices with --list (closes #137)


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/078a47f3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/078a47f3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/078a47f3

Branch: refs/heads/4.0.x
Commit: 078a47f3fa250b46b370d43530c040bf4f0ed5cd
Parents: e659373
Author: Carlos Santana <csantana23@carloss-mbp.raleigh.ibm.com>
Authored: Tue Apr 14 17:08:06 2015 -0400
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue Apr 14 14:18:37 2015 -0700

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/list-devices | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/078a47f3/bin/templates/scripts/cordova/lib/list-devices
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/list-devices b/bin/templates/scripts/cordova/lib/list-devices
index ddeb0b5..f612096 100755
--- a/bin/templates/scripts/cordova/lib/list-devices
+++ b/bin/templates/scripts/cordova/lib/list-devices
@@ -36,14 +36,16 @@ function listDevices() {
     ];
 
     // wrap al lexec calls into promises and wait until they're fullfilled
-    return Q.all(commands).then(function (promises) {
+    return Q.all(commands).then(function (results) {
         var accumulator = [];
-        promises.forEach(function (promise) {
-            if (promise.state === 'fulfilled') {
-                // Each command promise resolves with array [stout, stderr], and we need
stdout only
-                // Append stdout lines to accumulator
-                accumulator.concat(promise.value[0].trim().split('\n'));
-            }
+        results.forEach(function (result) {
+          var devicefound;
+          // Each command promise resolves with array [stout, stderr], and we need stdout
only
+          // Append stdout lines to accumulator
+          devicefound = result[0].trim().split('\n')[0];
+          if(devicefound !== ''){
+            accumulator.push(devicefound);
+          }
         });
         return accumulator;
     });


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


Mime
View raw message