Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('DOMContentLoaded', async function () {

// rather than looking for it all the time, you could just create an enum and change this once than updating every line
const github = {
repo: 'https://github.com/lapce/lapce',
version: 'v0.2.7',
version: (await (await fetch("https://api.github.com/repos/lapce/lapce/releases/latest")).json()).name,
windows: 'Lapce-windows.msi',
linux: 'Lapce-linux.tar.gz',
macos: 'Lapce-macos.dmg'
Expand Down Expand Up @@ -83,4 +83,4 @@ document.addEventListener('DOMContentLoaded', function () {
download.setAttribute("href", `${github.repo}/releases/download/${github.version}/${github.linux}`)
break;
}
});
});