From 2dc45a974da35dba0475ce784043676e3cea1b34 Mon Sep 17 00:00:00 2001 From: aparnajyothi-y <147696841+aparnajyothi-y@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:25:58 +0530 Subject: [PATCH] Update installer.ts --- src/distributions/dragonwell/installer.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/distributions/dragonwell/installer.ts b/src/distributions/dragonwell/installer.ts index 8c616f3..3e84757 100644 --- a/src/distributions/dragonwell/installer.ts +++ b/src/distributions/dragonwell/installer.ts @@ -149,9 +149,14 @@ export class DragonwellDistribution extends JavaBase { // 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. - 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) { eligibleVersions.push({