Skip to content

Commit 104bc4b

Browse files
committed
Merge branch 'main' of github.com:Moosync/Moosync.github.io
2 parents b262b9a + 80293e6 commit 104bc4b

24 files changed

+215
-2151
lines changed

assets/img/Architecture Diagram.jpeg

83.1 KB
Loading

assets/js/downloadUtils.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ function getSanitizedLinuxName (ext) {
105105
}
106106
}
107107

108+
function getSanitizedName(release) {
109+
if (release.url.includes('linux')) {
110+
return getSanitizedLinuxName(release.ext)
111+
}
112+
113+
const match = release.url.match(/^.*\/.*-\d+\.\d+\.\d+-([^.]*)\.(.*)$/)
114+
115+
return match && match.length === 3 ? `${match[1]}.${match[2]}` : release.ext
116+
}
117+
108118
export async function setupDownloadButton () {
109119
const os = getOS();
110120
const downloadParent = document.getElementById("downloads");
@@ -147,7 +157,7 @@ export async function setupDownloadButton () {
147157
for (const release of releases) {
148158
const optionDiv = document.createElement('div')
149159
optionDiv.classList.add('option')
150-
optionDiv.innerHTML = `${getSanitizedLinuxName(release.ext)}`
160+
optionDiv.innerHTML = `${getSanitizedName(release)}`
151161
optionsContainer.appendChild(optionDiv)
152162

153163
optionDiv.onclick = () => window.open(release.url)

0 commit comments

Comments
 (0)