Skip to content

Commit d1fc000

Browse files
Fix the bug about parsing dragonwell version (#642)
1 parent fd08b9c commit d1fc000

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

dist/setup/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124232,7 +124232,8 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
124232124232
// Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits).
124233124233
// 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.
124234124234
if (jdkVersion.split('.').length > 3) {
124235-
jdkVersion = (0, util_1.convertVersionToSemver)(jdkVersion);
124235+
const jdkVersionNums = jdkVersion.replace('+', '.').split('.');
124236+
jdkVersion = (0, util_1.convertVersionToSemver)(`${jdkVersionNums.slice(0, 3).join('.')}.${jdkVersionNums[jdkVersionNums.length - 1]}`);
124236124237
}
124237124238
for (const edition in archMap) {
124238124239
eligibleVersions.push({

src/distributions/dragonwell/installer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,14 @@ export class DragonwellDistribution extends JavaBase {
150150
// Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits).
151151
// 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.
152152
if (jdkVersion.split('.').length > 3) {
153-
jdkVersion = convertVersionToSemver(jdkVersion);
153+
const jdkVersionNums: string[] = jdkVersion
154+
.replace('+', '.')
155+
.split('.');
156+
jdkVersion = convertVersionToSemver(
157+
`${jdkVersionNums.slice(0, 3).join('.')}.${
158+
jdkVersionNums[jdkVersionNums.length - 1]
159+
}`
160+
);
154161
}
155162

156163
for (const edition in archMap) {

0 commit comments

Comments
 (0)