[ 
https://issues.apache.org/jira/browse/CB-9283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14618838#comment-14618838
 ] 

ASF GitHub Bot commented on CB-9283:
------------------------------------

Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/96#discussion_r34166452
  
    --- Diff: template/cordova/lib/package.js ---
    @@ -113,16 +112,32 @@ function getPackageName(platformPath) {
     
     // returns one of available devices which name match with provided string
     // return rejected promise if device with name specified not found
    -module.exports.findDevice = function (target) {
    +module.exports.findDevice = function (deploymentTool, target) {
         target = target.toLowerCase();
    -    return module.exports.listDevices().then(function(deviceList) {
    +    return deploymentTool.enumerateDevices().then(function(deviceList) {
             // 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]));
    +        // In CB-9283, we need to differentiate between emulator, device, 
and target.
    +        // So, for emulators to honor the above CB-7617, we preserve the 
original behavior.
    +        // Else, we choose either the target by ID (DeviceInfo.index) or 
if it's just device,
    +        // we choose the default (aka first) device.
    +        if (target === 'emulator') {
    +            var sortedList = deviceList.concat().sort(function (l, r) { 
return l.toString().length > r.toString().length; });
    --- End diff --
    
    concat() returns a copy of the original array.  
http://swingpants.com/2009/03/12/fastest-way-to-copy-an-array-concat-or-slice0/


> Windows 10: Migrate to new deployment infrastructure
> ----------------------------------------------------
>
>                 Key: CB-9283
>                 URL: https://issues.apache.org/jira/browse/CB-9283
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Windows
>            Reporter: Rob Paveza
>            Assignee: Rob Paveza
>
> The Windows 10 SDK includes a new deployment tool, WinAppDeployCmd, which 
> supercedes Windows Phone 8.1's AppDeployCmd.  Its command line interface is 
> incompatible.  This task is to migrate to WinAppDeployCmd.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to