Repository: cordova-wp8 Updated Branches: refs/heads/master a745b1293 -> 271de27b5
CB-7616 Deploy on WP8 fails to run specific target Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/271de27b Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/271de27b Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/271de27b Branch: refs/heads/master Commit: 271de27b5415867382ee292b1c8e6c62563fff64 Parents: a745b12 Author: sgrebnov <[email protected]> Authored: Tue Sep 23 10:48:22 2014 +0400 Committer: sgrebnov <[email protected]> Committed: Tue Sep 23 10:48:22 2014 +0400 ---------------------------------------------------------------------- template/cordova/lib/device.js | 3 ++- template/cordova/lib/package.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/271de27b/template/cordova/lib/device.js ---------------------------------------------------------------------- diff --git a/template/cordova/lib/device.js b/template/cordova/lib/device.js index f79a4fe..c963533 100644 --- a/template/cordova/lib/device.js +++ b/template/cordova/lib/device.js @@ -26,10 +26,11 @@ var Q = require('q'), // 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); } } http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/271de27b/template/cordova/lib/package.js ---------------------------------------------------------------------- diff --git a/template/cordova/lib/package.js b/template/cordova/lib/package.js index e7eeb89..684edd1 100644 --- a/template/cordova/lib/package.js +++ b/template/cordova/lib/package.js @@ -21,6 +21,7 @@ var Q = require('q'), fs = require('fs'), path = require('path'), shell = require('shelljs'), + device = require ('./device'), utils = require('./utils'); function Package (packagepath) { @@ -32,7 +33,7 @@ Package.prototype.deployTo = function (deployTarget) { return utils.getXapDeploy() .then(function (xapDeploy) { var getTarget = deployTarget == "device" ? Q("de") : - deployTarget == "emulator" ? Q("xd") : module.exports.findDevice(deployTarget); + deployTarget == "emulator" ? Q("xd") : device.findDevice(deployTarget); return getTarget.then(function (target) { return utils.spawn(xapDeploy, ['/installlaunch', pkg.packagePath, '/targetdevice:' + target]);
