Simplified latest parameter setting

This commit is contained in:
Gerrit Grunwald 2021-03-14 15:44:50 +01:00
parent a314fce4b5
commit 131290ed3e
2 changed files with 6 additions and 30 deletions

18
dist/setup/index.js vendored
View file

@ -33705,20 +33705,6 @@ function getDownloadInfo(refs, version, arch, javaPackage, distro = 'zulu') {
archiveType = distribution === 'ojdk_build' ? 'zip' : 'tar.gz'; 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; let url = constants_1.DISCO_URL + constants_1.PACKAGES_PATH;
url += '?distro=' + distribution; url += '?distro=' + distribution;
if (version.length != 0) { if (version.length != 0) {
@ -33738,7 +33724,9 @@ function getDownloadInfo(refs, version, arch, javaPackage, distro = 'zulu') {
url += '&architecture=' + architecture; url += '&architecture=' + architecture;
url += '&operating_system=' + operatingSystem; url += '&operating_system=' + operatingSystem;
url += '&archive_type=' + archiveType; url += '&archive_type=' + archiveType;
url += '&latest=' + latest; if (version.endsWith('x') || version.includes('ea')) {
url += '&latest=overall';
}
const http = new httpm.HttpClient('bundles', undefined, { const http = new httpm.HttpClient('bundles', undefined, {
allowRetries: true, allowRetries: true,
maxRetries: 3 maxRetries: 3

View file

@ -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; let url = DISCO_URL + PACKAGES_PATH;
url += '?distro=' + distribution; url += '?distro=' + distribution;
if (version.length != 0) { if (version.length != 0) {
@ -268,7 +254,9 @@ async function getDownloadInfo(
url += '&architecture=' + architecture; url += '&architecture=' + architecture;
url += '&operating_system=' + operatingSystem; url += '&operating_system=' + operatingSystem;
url += '&archive_type=' + archiveType; url += '&archive_type=' + archiveType;
url += '&latest=' + latest; if (version.endsWith('x') || version.includes('ea')) {
url += '&latest=overall';
}
const http = new httpm.HttpClient('bundles', undefined, { const http = new httpm.HttpClient('bundles', undefined, {
allowRetries: true, allowRetries: true,