From 22551b2bec832c61e1e21b63431bf151516ee04c Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Tue, 13 Feb 2024 17:16:15 +0100 Subject: [PATCH] Minor edit. --- dist/main/index.js | 8 ++++---- src/graalvm.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index b6a5550..958c25e 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -93861,7 +93861,8 @@ function setUpGraalVMJDK(javaVersionOrDev) { return setUpGraalVMJDKDevBuild(); } const javaVersion = javaVersionOrDev; - let toolName = determineToolName(javaVersion, false); + const toolName = determineToolName(javaVersion, false); + let downloadName = toolName; let downloadUrl; if (javaVersion.includes('.')) { if (semver.valid(javaVersion)) { @@ -93869,7 +93870,6 @@ function setUpGraalVMJDK(javaVersionOrDev) { 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); @@ -93884,7 +93884,7 @@ function setUpGraalVMJDK(javaVersionOrDev) { downloadUrl = yield 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 = () => __awaiter(this, void 0, void 0, function* () { return downloadGraalVMJDK(downloadUrl, javaVersion); }); return (0, utils_1.downloadExtractAndCacheJDK)(downloader, toolName, javaVersion); @@ -93945,7 +93945,7 @@ function findLatestGraalVMJDKCEJavaVersion(majorJavaVersion) { } exports.findLatestGraalVMJDKCEJavaVersion = findLatestGraalVMJDKCEJavaVersion; function determineToolName(javaVersion, isCommunity) { - return `graalvm${isCommunity ? '-community' : ''}-jdk-${(0, utils_1.toSemVer)(javaVersion)}_${c.JDK_PLATFORM}-${c.JDK_ARCH}_bin`; + return `graalvm${isCommunity ? '-community' : ''}-jdk-${javaVersion}_${c.JDK_PLATFORM}-${c.JDK_ARCH}_bin`; } function downloadGraalVMJDK(downloadUrl, javaVersion) { return __awaiter(this, void 0, void 0, function* () { diff --git a/src/graalvm.ts b/src/graalvm.ts index 2b12414..f8c1fd8 100644 --- a/src/graalvm.ts +++ b/src/graalvm.ts @@ -29,7 +29,8 @@ 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)) { @@ -37,7 +38,6 @@ export async function setUpGraalVMJDK( 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) @@ -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) @@ -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` }