You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2014/09/29 10:14:36 UTC

[1/2] git commit: CB-7617 Deploy on WP8.1 incorrectly handles --target name

Repository: cordova-windows
Updated Branches:
  refs/heads/3.6.x 2aa00365d -> 7b594a5be


CB-7617 Deploy on WP8.1 incorrectly handles --target name


Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/52437e68
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/52437e68
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/52437e68

Branch: refs/heads/3.6.x
Commit: 52437e68b50ae7334b2e52dc04131cb16ca8c4d9
Parents: 2aa0036
Author: sgrebnov <v-...@microsoft.com>
Authored: Tue Sep 23 11:24:09 2014 +0400
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Fri Sep 26 12:28:13 2014 +0400

----------------------------------------------------------------------
 windows/template/cordova/lib/package.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/52437e68/windows/template/cordova/lib/package.js
----------------------------------------------------------------------
diff --git a/windows/template/cordova/lib/package.js b/windows/template/cordova/lib/package.js
index 95a15c2..23c5709 100644
--- a/windows/template/cordova/lib/package.js
+++ b/windows/template/cordova/lib/package.js
@@ -115,9 +115,10 @@ module.exports.getPackageName = function (platformPath) {
 // returns one of available devices which name match with parovided string
 // return rejected promise if device with name specified not found
 module.exports.findDevice = function (target) {
+    target = target.toLowerCase();
     return module.exports.listDevices().then(function(deviceList) {
         for (var idx in deviceList){
-            if (deviceList[idx].indexOf(target) > -1) {
+            if (deviceList[idx].toLowerCase() == target) {
                 return Q.resolve(idx);
             }
         }


[2/2] git commit: CB-7617 partial match support for --target

Posted by sg...@apache.org.
CB-7617 partial match support for --target


Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/7b594a5b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/7b594a5b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/7b594a5b

Branch: refs/heads/3.6.x
Commit: 7b594a5be8db03d75a848abf19cece5230f57f6b
Parents: 52437e6
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Sep 29 12:00:11 2014 +0400
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Sep 29 12:00:11 2014 +0400

----------------------------------------------------------------------
 windows/template/cordova/lib/package.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/7b594a5b/windows/template/cordova/lib/package.js
----------------------------------------------------------------------
diff --git a/windows/template/cordova/lib/package.js b/windows/template/cordova/lib/package.js
index 23c5709..366cb6e 100644
--- a/windows/template/cordova/lib/package.js
+++ b/windows/template/cordova/lib/package.js
@@ -117,9 +117,13 @@ module.exports.getPackageName = function (platformPath) {
 module.exports.findDevice = function (target) {
     target = target.toLowerCase();
     return module.exports.listDevices().then(function(deviceList) {
-        for (var idx in deviceList){
-            if (deviceList[idx].toLowerCase() == target) {
-                return Q.resolve(idx);
+        // CB-7617 since we use partial match shorter names should go first,
+        // example case is ['Emulator 8.1 WVGA 4 inch 512MB', 'Emulator 8.1 WVGA 4 inch']
+        var sortedList = deviceList.concat().sort(function (l, r) { return l.length > r.length; });
+        for (var idx in sortedList){
+            if (sortedList[idx].toLowerCase().indexOf(target) > -1) {
+                // we should return index based on original list
+                return Q.resolve(deviceList.indexOf(sortedList[idx]));
             }
         }
         return Q.reject('Specified device not found');