cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [08/10] android commit: CB-12524: Forgot to check for the android command on the target check
Date Mon, 13 Mar 2017 20:51:51 GMT
CB-12524: Forgot to check for the android command on the target check


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

Branch: refs/heads/master
Commit: 9dbffa6ee83ee0019cebb6262c78958e7e3b1086
Parents: 2d3f3ca
Author: Joe Bowser <bowserj@apache.org>
Authored: Mon Mar 13 11:16:48 2017 -0700
Committer: Joe Bowser <bowserj@apache.org>
Committed: Mon Mar 13 13:51:37 2017 -0700

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9dbffa6e/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index c6898e7..eb1e4d1 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -257,6 +257,8 @@ module.exports.check_android = function() {
 
 module.exports.getAbsoluteAndroidCmd = function () {
     var cmd = forgivingWhichSync('android');
+    if(cmd.length === 0)
+      cmd = forgivingWhichSync('avdmanager');
     if (process.platform === 'win32') {
         return '"' + cmd + '"';
     }
@@ -270,8 +272,11 @@ module.exports.check_android_target = function(originalError) {
     //   Google Inc.:Google APIs:20
     //   Google Inc.:Glass Development Kit Preview:20
     var valid_target = module.exports.get_target();
-    var msg = 'Android SDK not found. Make sure that it is installed. If it is not at the
default location, set the ANDROID_HOME environment variable.';
-    return tryCommand('android list targets --compact', msg)
+    //   Changing "targets" to "target" is stupid and makes more code.  Thanks Google!
+    var cmd = "android list targets --compact";
+    if(forgivingWhichSync('avdmanager').length > 0)
+      cmd = "avdmanager list target --compact";
+    return tryCommand(cmd, msg)
     .then(function(output) {
         var targets = output.split('\n');
         if (targets.indexOf(valid_target) >= 0) {


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


Mime
View raw message