mirror of
https://gitea.com/actions/setup-android.git
synced 2025-12-12 19:36:59 +00:00
Read version of cmdline-tools/latest, if version is correct - use it
This commit is contained in:
committed by
Vilius Sutkus '89
parent
88c04cbb34
commit
4360e92aa0
6
dist/index.js
vendored
6
dist/index.js
vendored
@@ -8589,6 +8589,12 @@ function findPreinstalledSdkManager() {
|
||||
result.exePath = getSdkManagerPath('latest');
|
||||
result.isFound = fs.existsSync(result.exePath);
|
||||
if (result.isFound) {
|
||||
const propertiesFile = path.join(ANDROID_SDK_ROOT, 'cmdline-tools', 'latest', 'source.properties');
|
||||
if (fs.existsSync(propertiesFile)) {
|
||||
const correctRevisionString = `Pkg.Revision=${CMDLINE_TOOLS_VERSION}`;
|
||||
console.log(correctRevisionString);
|
||||
result.isCorrectVersion = fs.readFileSync(propertiesFile, 'utf8').includes(correctRevisionString);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
result.exePath = '';
|
||||
|
||||
Reference in New Issue
Block a user