mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
Corretto toolcache folder name fix (#480)
This commit is contained in:
parent
404e5db3a1
commit
ddb82ce8a6
7 changed files with 62 additions and 49 deletions
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue