|
12 | 12 | // === Fetch link to Everest |
13 | 13 |
|
14 | 14 | { |
15 | | - // a static file on this website indicates to Everest and Olympus where the Everest versions list is provided, |
16 | | - // so load the URL from there as well... |
17 | | - const updaterUrlFetch = await fetch("/everestupdater.txt"); |
18 | | - |
19 | | - if (updaterUrlFetch.ok) { |
20 | | - // ... then call it. |
21 | | - const updaterUrl = await updaterUrlFetch.text(); |
22 | | - const versionListFetch = await fetch(updaterUrl.trim() + "?supportsNativeBuilds=true"); |
23 | | - |
24 | | - if (versionListFetch.ok) { |
25 | | - const versionList = await versionListFetch.json(); |
26 | | - |
27 | | - const stable = getLinkForBranch(versionList, "stable").mainDownload; |
28 | | - const beta = getLinkForBranch(versionList, "beta").mainDownload; |
29 | | - const dev = getLinkForBranch(versionList, "dev").mainDownload; |
30 | | - |
31 | | - // if all versions have an existing build... |
32 | | - if (stable !== null && beta !== null && dev !== null) { |
33 | | - // set the links to their artifacts |
34 | | - document.getElementById("latest-stable-link").href = stable; |
35 | | - document.getElementById("latest-beta-link").href = beta; |
36 | | - document.getElementById("latest-dev-link").href = dev; |
37 | | - |
38 | | - // remove the line saying "Click the '1 published' button under 'Related', then 'main' to download it." since those are now direct links. |
39 | | - var artifactInstructions = document.getElementById("artifact-instructions"); |
40 | | - artifactInstructions.parentNode.removeChild(artifactInstructions); |
41 | | - } |
| 15 | + // call the API mirror on this very website to retrieve the versions list |
| 16 | + const versionListFetch = await fetch("https://everestapi.github.io/updatermirror/everest_versions.json"); |
| 17 | + |
| 18 | + if (versionListFetch.ok) { |
| 19 | + const versionList = await versionListFetch.json(); |
| 20 | + |
| 21 | + const stable = getLinkForBranch(versionList, "stable").mainDownload; |
| 22 | + const beta = getLinkForBranch(versionList, "beta").mainDownload; |
| 23 | + const dev = getLinkForBranch(versionList, "dev").mainDownload; |
| 24 | + |
| 25 | + // if all versions have an existing build... |
| 26 | + if (stable !== null && beta !== null && dev !== null) { |
| 27 | + // set the links to their artifacts |
| 28 | + document.getElementById("latest-stable-link").href = stable; |
| 29 | + document.getElementById("latest-beta-link").href = beta; |
| 30 | + document.getElementById("latest-dev-link").href = dev; |
| 31 | + |
| 32 | + // remove the line saying "Click the '1 published' button under 'Related', then 'main' to download it." since those are now direct links. |
| 33 | + var artifactInstructions = document.getElementById("artifact-instructions"); |
| 34 | + artifactInstructions.parentNode.removeChild(artifactInstructions); |
42 | 35 | } |
43 | 36 | } |
44 | 37 | } |
|
47 | 40 | // === Fetch link to Olympus |
48 | 41 |
|
49 | 42 | { |
50 | | - const updaterUrlFetch = await fetch("/olympusupdater.txt"); |
| 43 | + // call the API mirror on this very website to retrieve the versions list |
| 44 | + const versionListFetch = await fetch("https://everestapi.github.io/updatermirror/olympus_versions.json"); |
51 | 45 |
|
52 | | - if (updaterUrlFetch.ok) { |
53 | | - // ... then call it. |
54 | | - const updaterUrl = await updaterUrlFetch.text(); |
55 | | - const versionListFetch = await fetch(updaterUrl.trim()); |
| 46 | + if (versionListFetch.ok) { |
| 47 | + const versionList = await versionListFetch.json(); |
56 | 48 |
|
57 | | - if (versionListFetch.ok) { |
58 | | - const versionList = await versionListFetch.json(); |
| 49 | + const stable = getLinkForBranch(versionList, "stable"); |
59 | 50 |
|
60 | | - const stable = getLinkForBranch(versionList, "stable"); |
| 51 | + if (stable !== null) { |
| 52 | + // set the links to the latest stable |
| 53 | + document.getElementById("olympus-macos-latest-link").href = stable.macosDownload; |
| 54 | + document.getElementById("olympus-linux-latest-link").href = stable.linuxDownload; |
61 | 55 |
|
62 | | - if (stable !== null) { |
63 | | - // set the links to the latest stable |
64 | | - document.getElementById("olympus-macos-latest-link").href = stable.macosDownload; |
65 | | - document.getElementById("olympus-linux-latest-link").href = stable.linuxDownload; |
66 | | - |
67 | | - // remove the line saying "Click the '5 published' button under 'Related', then '...main' to download it." since those are now direct links. |
68 | | - const artifactInstructionsMacOS = document.getElementById("olympus-macos-artifact-instructions"); |
69 | | - artifactInstructionsMacOS.parentNode.removeChild(artifactInstructionsMacOS); |
70 | | - const artifactInstructionsLinux = document.getElementById("olympus-linux-artifact-instructions"); |
71 | | - artifactInstructionsLinux.parentNode.removeChild(artifactInstructionsLinux); |
72 | | - } |
| 56 | + // remove the line saying "Click the '5 published' button under 'Related', then '...main' to download it." since those are now direct links. |
| 57 | + const artifactInstructionsMacOS = document.getElementById("olympus-macos-artifact-instructions"); |
| 58 | + artifactInstructionsMacOS.parentNode.removeChild(artifactInstructionsMacOS); |
| 59 | + const artifactInstructionsLinux = document.getElementById("olympus-linux-artifact-instructions"); |
| 60 | + artifactInstructionsLinux.parentNode.removeChild(artifactInstructionsLinux); |
73 | 61 | } |
74 | 62 | } |
75 | 63 | } |
|
0 commit comments