mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
CB-12605 Fix a requirements check failure on Windows
This commit is contained in:
parent
ea8d65d7fc
commit
08c80f77a9
17
bin/templates/cordova/lib/check_reqs.js
vendored
17
bin/templates/cordova/lib/check_reqs.js
vendored
@ -100,22 +100,23 @@ module.exports.get_gradle_wrapper = function() {
|
|||||||
var program_dir;
|
var program_dir;
|
||||||
if (module.exports.isDarwin()) {
|
if (module.exports.isDarwin()) {
|
||||||
program_dir = fs.readdirSync('/Applications');
|
program_dir = fs.readdirSync('/Applications');
|
||||||
while(i < program_dir.length && !foundStudio) {
|
while (i < program_dir.length && !foundStudio) {
|
||||||
if(program_dir[i].startsWith('Android Studio')) {
|
if (program_dir[i].startsWith('Android Studio')) {
|
||||||
//TODO: Check for a specific Android Studio version, make sure it's not Canary
|
//TODO: Check for a specific Android Studio version, make sure it's not Canary
|
||||||
androidStudioPath = path.join('/Applications', program_dir[i], 'Contents', 'gradle');
|
androidStudioPath = path.join('/Applications', program_dir[i], 'Contents', 'gradle');
|
||||||
foundStudio = true;
|
foundStudio = true;
|
||||||
} else { ++i; }
|
} else { ++i; }
|
||||||
}
|
}
|
||||||
} else if (module.exports.isWindows()) {
|
} else if (module.exports.isWindows()) {
|
||||||
var androidPath = path.join(process.env['ProgramFiles'], 'Android');
|
var androidPath = path.join(process.env['ProgramFiles'], 'Android') + '/';
|
||||||
program_dir = fs.readdirSync(androidPath + '/');
|
if (fs.existsSync(androidPath)) {
|
||||||
while(i < program_dir.length && !foundStudio) {
|
program_dir = fs.readdirSync(androidPath);
|
||||||
if(program_dir[i].startsWith('Android Studio')) {
|
while (i < program_dir.length && !foundStudio) {
|
||||||
|
if (program_dir[i].startsWith('Android Studio')) {
|
||||||
foundStudio = true;
|
foundStudio = true;
|
||||||
androidStudioPath = path.join(process.env['ProgramFiles'],'Android', program_dir[i], 'gradle');
|
androidStudioPath = path.join(process.env['ProgramFiles'], 'Android', program_dir[i], 'gradle');
|
||||||
|
} else { ++i; }
|
||||||
}
|
}
|
||||||
else { ++i; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user