From 131290ed3e4ae9854d7bdbc78c10773b9ac92959 Mon Sep 17 00:00:00 2001 From: Gerrit Grunwald Date: Sun, 14 Mar 2021 15:44:50 +0100 Subject: [PATCH] Simplified latest parameter setting --- dist/setup/index.js | 18 +++--------------- src/installer.ts | 18 +++--------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 9c871146..4b612c39 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -33705,20 +33705,6 @@ function getDownloadInfo(refs, version, arch, javaPackage, distro = 'zulu') { archiveType = distribution === 'ojdk_build' ? 'zip' : 'tar.gz'; } } - let latest = ''; - if (version.endsWith('x')) { - if (version.endsWith('.x')) { - version = version.slice(0, -2); - latest = 'per_version'; - } - else { - version = version.slice(0, -1); - latest = 'overall'; - } - } - if (version.includes('ea')) { - latest = 'overall'; - } let url = constants_1.DISCO_URL + constants_1.PACKAGES_PATH; url += '?distro=' + distribution; if (version.length != 0) { @@ -33738,7 +33724,9 @@ function getDownloadInfo(refs, version, arch, javaPackage, distro = 'zulu') { url += '&architecture=' + architecture; url += '&operating_system=' + operatingSystem; url += '&archive_type=' + archiveType; - url += '&latest=' + latest; + if (version.endsWith('x') || version.includes('ea')) { + url += '&latest=overall'; + } const http = new httpm.HttpClient('bundles', undefined, { allowRetries: true, maxRetries: 3 diff --git a/src/installer.ts b/src/installer.ts index 8fc2699c..49a1f4fb 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -236,20 +236,6 @@ async function getDownloadInfo( } } - let latest = ''; - if (version.endsWith('x')) { - if (version.endsWith('.x')) { - version = version.slice(0, -2); - latest = 'per_version'; - } else { - version = version.slice(0, -1); - latest = 'overall'; - } - } - if (version.includes('ea')) { - latest = 'overall'; - } - let url = DISCO_URL + PACKAGES_PATH; url += '?distro=' + distribution; if (version.length != 0) { @@ -268,7 +254,9 @@ async function getDownloadInfo( url += '&architecture=' + architecture; url += '&operating_system=' + operatingSystem; url += '&archive_type=' + archiveType; - url += '&latest=' + latest; + if (version.endsWith('x') || version.includes('ea')) { + url += '&latest=overall'; + } const http = new httpm.HttpClient('bundles', undefined, { allowRetries: true,