cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [5/9] ios commit: CB-9013 - Fix listing of multiple devices in list-devices for iOS (closes #140)
Date Tue, 19 May 2015 23:21:16 GMT
CB-9013 - Fix listing of multiple devices in list-devices for iOS (closes #140)

when multiple of same type devices are connected, like two iPhones,
only the first was returned.

Now all connected devices will be returned.

Note it might be even better if there was a way to get the devices
names as descriptions because now they are all called ‘iPhone’

Signed-off-by: Shazron Abdullah <shazron@apache.org>


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

Branch: refs/heads/4.0.x
Commit: 19187a28bbef31b7c93df18aaf43bc6c1c68bddc
Parents: 53b1526
Author: George Petrov <george@dmxzone.com>
Authored: Mon May 11 22:24:21 2015 +0200
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue May 12 13:38:04 2015 -0700

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/list-devices | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/19187a28/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 f612096..3fa3e6d 100755
--- a/bin/templates/scripts/cordova/lib/list-devices
+++ b/bin/templates/scripts/cordova/lib/list-devices
@@ -42,9 +42,13 @@ function listDevices() {
           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);
+          devicefound = result[0].trim().split('\n');
+          if(devicefound && devicefound.length) {
+            devicefound.forEach(function(device) {
+              if (device) {
+                accumulator.push(device);
+              }
+            });
           }
         });
         return accumulator;
@@ -61,4 +65,4 @@ if (!module.parent) {
             console.log(device);
         });
     });
-}
+}
\ No newline at end of file


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


Mime
View raw message