cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgreb...@apache.org
Subject [3/3] cordova-wp8 git commit: CB-8060 Updated AppDeployCmd lookup code
Date Fri, 26 Dec 2014 10:08:41 GMT
CB-8060 Updated AppDeployCmd lookup code

github: close #67


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/4ea34104
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/4ea34104
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/4ea34104

Branch: refs/heads/master
Commit: 4ea34104127ca944c15e6aa0a42e9c2f8e25f1f6
Parents: 3d9c8f6
Author: sgrebnov <v-segreb@microsoft.com>
Authored: Fri Dec 26 13:08:28 2014 +0300
Committer: sgrebnov <v-segreb@microsoft.com>
Committed: Fri Dec 26 13:08:28 2014 +0300

----------------------------------------------------------------------
 template/cordova/lib/utils.js | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/4ea34104/template/cordova/lib/utils.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/utils.js b/template/cordova/lib/utils.js
index f3efd7e..eaea655 100644
--- a/template/cordova/lib/utils.js
+++ b/template/cordova/lib/utils.js
@@ -25,22 +25,23 @@ var Q    = require('Q'),
 
 // returns path to app deployment util from Windows Phone 8.x SDK
 module.exports.getXapDeploy = function () {
-    // Try the newer AppDeploy first
-    var appDeployUtils = path.join((process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]),
-        'Microsoft SDKs', 'Windows Phone', 'v8.1', 'Tools', 'AppDeploy', 'AppDeployCmd.exe');
-    if (fs.existsSync(appDeployUtils)) {
-        return Q.resolve(appDeployUtils);
-    }
-    
-    // If AppDeployCmd wasn't found, try XapDeployCmd
-    var xapDeployUtils = path.join((process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]),
-        'Microsoft SDKs', 'Windows Phone', 'v8.0', 'Tools', 'Xap Deployment', 'XapDeployCmd.exe');
-    // Check if XapDeployCmd is exists
-    if (!fs.existsSync(xapDeployUtils)) {
-        console.warn("WARNING: XapDeploy tool (XapDeployCmd.exe) didn't found. Assume that
it's in %PATH%");
-        return Q.resolve("XapDeployCmd");
+    var toolsLookupLocations = [
+        // Windows Phone 8.1
+        path.join((process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]),
+        'Microsoft SDKs', 'Windows Phone', 'v8.1', 'Tools', 'AppDeploy', 'AppDeployCmd.exe'),
+        // Windows Phone 8.0
+        path.join((process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]),
+        'Microsoft SDKs', 'Windows Phone', 'v8.0', 'Tools', 'Xap Deployment', 'XapDeployCmd.exe')
+    ];
+
+    for (idx in toolsLookupLocations) {
+        if (fs.existsSync(toolsLookupLocations[idx])) {
+            return Q.resolve(toolsLookupLocations[idx]);
+        }
     }
-    return Q.resolve(xapDeployUtils);
+
+    console.warn("WARNING: XapDeploy tool (XapDeployCmd.exe) didn't found. Assume that it's
in %PATH%");
+    return Q.resolve("XapDeployCmd");
 };
 
 module.exports.getOSVersion = function () {


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


Mime
View raw message