breautek commented on code in PR #1877:
URL: https://github.com/apache/cordova-android/pull/1877#discussion_r2628949000


##########
lib/check_reqs.js:
##########
@@ -216,14 +217,14 @@ module.exports.check_android = function () {
                 }
             }
             if (avdmanagerInPath) {
-                parentDir = path.dirname(avdmanagerInPath);
-                grandParentDir = path.dirname(parentDir);
-                if (path.basename(parentDir) === 'bin' && 
path.basename(grandParentDir) === 'tools') {
-                    maybeSetAndroidHome(path.dirname(grandParentDir));
+                let sdkPath = null;
+                if (/cmdline-tools/.test(avdmanagerInPath)) {
+                    sdkPath = path.resolve(avdmanagerInPath, '../../../..');
+                    maybeSetAndroidHome(sdkPath);
                 } else {
                     throw new CordovaError('Failed to find \'ANDROID_HOME\' 
environment variable. Try setting it manually.\n' +
-                        'Detected \'avdmanager\' command at ' + parentDir + ' 
but no \'tools' + path.sep + 'bin\' directory found near.\n' +
-                        'Try reinstall Android SDK or update your PATH to 
include valid path to SDK' + path.sep + 'tools' + path.sep + 'bin directory.');
+                        'Detected \'avdmanager\' command at ' + parentDir + ' 
but Android SDK near.\n' +

Review Comment:
   If we want proper English, yah probably lol



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to