janpio closed pull request #240: CB-13155: Improved target parsing
URL: https://github.com/apache/cordova-windows/pull/240
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/template/cordova/lib/package.js b/template/cordova/lib/package.js
index 6269885f..d811f4da 100644
--- a/template/cordova/lib/package.js
+++ b/template/cordova/lib/package.js
@@ -147,7 +147,10 @@ module.exports.findDevice = function (deploymentTool, 
target) {
             return Q.resolve(deviceList[0]);
         } else {
             var candidateList = deviceList.filter(function (device) {
-                return device.index === parseInt(target, 10);
+                var deviceIndexEqualsTarget = device.index === 
parseInt(target, 10);
+                var deviceNameContainsTarget = 
device.name.toLowerCase().indexOf(target.toLowerCase()) >= 0;
+                
+                return deviceIndexEqualsTarget || deviceNameContainsTarget;
             });
 
             if (candidateList.length > 0) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to