Corretto toolcache folder name fix (#480)

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

No files matched your search

+10
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;
}