mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
CB-12524: Forgot to check for the android command on the target check
This commit is contained in:
parent
2d3f3cae13
commit
9dbffa6ee8
@ -257,6 +257,8 @@ module.exports.check_android = function() {
|
|||||||
|
|
||||||
module.exports.getAbsoluteAndroidCmd = function () {
|
module.exports.getAbsoluteAndroidCmd = function () {
|
||||||
var cmd = forgivingWhichSync('android');
|
var cmd = forgivingWhichSync('android');
|
||||||
|
if(cmd.length === 0)
|
||||||
|
cmd = forgivingWhichSync('avdmanager');
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
return '"' + cmd + '"';
|
return '"' + cmd + '"';
|
||||||
}
|
}
|
||||||
@ -270,8 +272,11 @@ module.exports.check_android_target = function(originalError) {
|
|||||||
// Google Inc.:Google APIs:20
|
// Google Inc.:Google APIs:20
|
||||||
// Google Inc.:Glass Development Kit Preview:20
|
// Google Inc.:Glass Development Kit Preview:20
|
||||||
var valid_target = module.exports.get_target();
|
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.';
|
// Changing "targets" to "target" is stupid and makes more code. Thanks Google!
|
||||||
return tryCommand('android list targets --compact', msg)
|
var cmd = "android list targets --compact";
|
||||||
|
if(forgivingWhichSync('avdmanager').length > 0)
|
||||||
|
cmd = "avdmanager list target --compact";
|
||||||
|
return tryCommand(cmd, msg)
|
||||||
.then(function(output) {
|
.then(function(output) {
|
||||||
var targets = output.split('\n');
|
var targets = output.split('\n');
|
||||||
if (targets.indexOf(valid_target) >= 0) {
|
if (targets.indexOf(valid_target) >= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user