Skip to content

Commit

Permalink
Fix the bug about parsing dragonwell version (actions#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
Accelerator1996 committed Jul 1, 2024
1 parent fd08b9c commit 2f86b5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124232,6 +124232,11 @@ class DragonwellDistribution extends base_installer_1.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 = jdkVersion.split('.').slice(0, 3).join('.');
if (jdkVersion.includes('+')) {
const buildParts = jdkVersion.split('+');
jdkVersion += buildParts[buildParts.length - 1];
}
jdkVersion = (0, util_1.convertVersionToSemver)(jdkVersion);
}
for (const edition in archMap) {
Expand Down
5 changes: 5 additions & 0 deletions src/distributions/dragonwell/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ 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 = jdkVersion.split('.').slice(0, 3).join('.');
if (jdkVersion.includes('+')) {
const buildParts: string[] = jdkVersion.split('+');
jdkVersion += buildParts[buildParts.length - 1];
}
jdkVersion = convertVersionToSemver(jdkVersion);
}

Expand Down

0 comments on commit 2f86b5b

Please sign in to comment.