mirror of
https://gitea.com/actions/setup-java.git
synced 2025-04-05 23:09:37 +00:00
Corretto toolcache folder name fix (#480)
This commit is contained in:
10
src/util.ts
10
src/util.ts
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user