mirror of
https://github.com/android-actions/setup-android.git
synced 2024-11-27 12:02:03 +00:00
Read version of cmdline-tools/latest, if version is correct - use it
This commit is contained in:
parent
0f0da39d59
commit
c1ac9c4be4
1 changed files with 6 additions and 0 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
@ -8589,6 +8589,12 @@ function findPreinstalledSdkManager() {
|
||||||
result.exePath = getSdkManagerPath('latest');
|
result.exePath = getSdkManagerPath('latest');
|
||||||
result.isFound = fs.existsSync(result.exePath);
|
result.isFound = fs.existsSync(result.exePath);
|
||||||
if (result.isFound) {
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
result.exePath = '';
|
result.exePath = '';
|
||||||
|
|
Loading…
Reference in a new issue