Corretto toolcache folder name fix (#480)

This commit is contained in:
Ivan
2023-04-10 10:29:19 +02:00
committed by GitHub
parent 404e5db3a1
commit ddb82ce8a6
7 changed files with 62 additions and 49 deletions

View File

@ -151,3 +151,13 @@ export function getVersionFromFileContent(
function avoidOldNotation(content: string): string {
return content.startsWith('1.') ? content.substring(2) : content;
}
export function convertVersionToSemver(version: number[] | string) {
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
const versionArray = Array.isArray(version) ? version : version.split('.');
const mainVersion = versionArray.slice(0, 3).join('.');
if (versionArray.length > 3) {
return `${mainVersion}+${versionArray.slice(3).join('.')}`;
}
return mainVersion;
}