Skip to content

Commit

Permalink
Minor edit.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Feb 13, 2024
1 parent bf3e45b commit 22551b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/graalvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export async function setUpGraalVMJDK(
return setUpGraalVMJDKDevBuild()
}
const javaVersion = javaVersionOrDev
let toolName = determineToolName(javaVersion, false)
const toolName = determineToolName(javaVersion, false)
let downloadName = toolName
let downloadUrl: string
if (javaVersion.includes('.')) {
if (semver.valid(javaVersion)) {
const majorJavaVersion = semver.major(javaVersion)
const minorJavaVersion = semver.minor(javaVersion)
const patchJavaVersion = semver.patch(javaVersion)
const isGARelease = minorJavaVersion === 0 && patchJavaVersion === 0
let downloadName = toolName
if (isGARelease) {
// For GA versions of JDKs, /archive/ does not use minor and patch version (see https://www.oracle.com/java/technologies/jdk-script-friendly-urls/)
downloadName = determineToolName(majorJavaVersion.toString(), false)
Expand All @@ -51,7 +51,7 @@ export async function setUpGraalVMJDK(
} else if (javaVersion === '22-ea') {
downloadUrl = await findLatestEABuildDownloadUrl(javaVersion)
} else {
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${toolName}${c.GRAALVM_FILE_EXTENSION}`
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${downloadName}${c.GRAALVM_FILE_EXTENSION}`
}
const downloader = async () => downloadGraalVMJDK(downloadUrl, javaVersion)
return downloadExtractAndCacheJDK(downloader, toolName, javaVersion)
Expand Down Expand Up @@ -126,7 +126,7 @@ export async function findLatestGraalVMJDKCEJavaVersion(
}

function determineToolName(javaVersion: string, isCommunity: boolean) {
return `graalvm${isCommunity ? '-community' : ''}-jdk-${toSemVer(javaVersion)}_${
return `graalvm${isCommunity ? '-community' : ''}-jdk-${javaVersion}_${
c.JDK_PLATFORM
}-${c.JDK_ARCH}_bin`
}
Expand Down

0 comments on commit 22551b2

Please sign in to comment.