Fix the bug about parsing dragonwell version (#642)

This commit is contained in:
lvfei.lv 2024-07-01 15:49:07 +08:00
parent fd08b9c8dc
commit 21458133ed
2 changed files with 12 additions and 2 deletions

5
dist/setup/index.js vendored
View File

@ -124232,7 +124232,10 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
// Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits). // Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits).
// Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools. // Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools.
if (jdkVersion.split('.').length > 3) { if (jdkVersion.split('.').length > 3) {
jdkVersion = (0, util_1.convertVersionToSemver)(jdkVersion); const jdkVersionNums = jdkVersion
.replace('+', '.')
.split('.');
jdkVersion = (0, util_1.convertVersionToSemver)(`${jdkVersionNums.slice(0, 3).join('.')}.${jdkVersionNums[jdkVersionNums.length - 1]}`);
} }
for (const edition in archMap) { for (const edition in archMap) {
eligibleVersions.push({ eligibleVersions.push({

View File

@ -150,7 +150,14 @@ export class DragonwellDistribution extends JavaBase {
// Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits). // Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits).
// Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools. // Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools.
if (jdkVersion.split('.').length > 3) { if (jdkVersion.split('.').length > 3) {
jdkVersion = convertVersionToSemver(jdkVersion); const jdkVersionNums: string[] = jdkVersion
.replace('+', '.')
.split('.');
jdkVersion = convertVersionToSemver(
`${jdkVersionNums.slice(0, 3).join('.')}.${
jdkVersionNums[jdkVersionNums.length - 1]
}`
);
} }
for (const edition in archMap) { for (const edition in archMap) {