cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alsoro...@apache.org
Subject android commit: CB-12605 Fix a requirements check failure on Windows
Date Mon, 27 Mar 2017 09:16:18 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/master ea8d65d7f -> 08c80f77a


CB-12605 Fix a requirements check failure on Windows


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/08c80f77
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/08c80f77
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/08c80f77

Branch: refs/heads/master
Commit: 08c80f77a96808520ece8931de6192d550598a71
Parents: ea8d65d
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Authored: Mon Mar 27 11:47:32 2017 +0300
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Mon Mar 27 11:47:32 2017 +0300

----------------------------------------------------------------------
 bin/templates/cordova/lib/check_reqs.js | 29 ++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/08c80f77/bin/templates/cordova/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/check_reqs.js b/bin/templates/cordova/lib/check_reqs.js
index b4eb336..1fd397a 100644
--- a/bin/templates/cordova/lib/check_reqs.js
+++ b/bin/templates/cordova/lib/check_reqs.js
@@ -100,22 +100,23 @@ module.exports.get_gradle_wrapper = function() {
     var program_dir;
     if (module.exports.isDarwin()) {
         program_dir = fs.readdirSync('/Applications');
-        while(i < program_dir.length && !foundStudio) {
-          if(program_dir[i].startsWith('Android Studio')) {
-            //TODO: Check for a specific Android Studio version, make sure it's not Canary
-            androidStudioPath = path.join('/Applications', program_dir[i], 'Contents', 'gradle');
-            foundStudio = true;
-          } else { ++i; }
+        while (i < program_dir.length && !foundStudio) {
+            if (program_dir[i].startsWith('Android Studio')) {
+                //TODO: Check for a specific Android Studio version, make sure it's not Canary
+                androidStudioPath = path.join('/Applications', program_dir[i], 'Contents',
'gradle');
+                foundStudio = true;
+            } else { ++i; }
         }
     } else if (module.exports.isWindows()) {
-    var androidPath = path.join(process.env['ProgramFiles'], 'Android');
-        program_dir = fs.readdirSync(androidPath + '/');
-        while(i < program_dir.length && !foundStudio) {
-          if(program_dir[i].startsWith('Android Studio')) {
-            foundStudio = true;
-            androidStudioPath = path.join(process.env['ProgramFiles'],'Android', program_dir[i],
'gradle');
-          }
-          else { ++i; }
+        var androidPath = path.join(process.env['ProgramFiles'], 'Android') + '/';
+        if (fs.existsSync(androidPath)) {
+            program_dir = fs.readdirSync(androidPath);
+            while (i < program_dir.length && !foundStudio) {
+                if (program_dir[i].startsWith('Android Studio')) {
+                    foundStudio = true;
+                    androidStudioPath = path.join(process.env['ProgramFiles'], 'Android',
program_dir[i], 'gradle');
+                } else { ++i; }
+            }
         }
     }
 


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


Mime
View raw message