Skip to content

Commit 921b703

Browse files
committed
Fix download on both pages
1 parent 4e8b599 commit 921b703

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

apps/api/src/handlers/updater.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ app.get("/latest/canary", async (c) => {
5454

5555
// get the latest canary build for each platform
5656
const downloads = files.objects
57+
.filter((file) => file?.key !== "canary/latest.json")
5758
.map((file) => {
5859
const platform = file.key.split("/")[1].split("-")[2];
5960
return {
6061
name: file.key,
6162
url: `https://artifacts.overlayed.dev/${file.key}`,
62-
platform: platform.replace(".zip", ""),
63+
platform: platform.slice(0, -4),
6364
};
64-
})
65-
.filter((file) => file.name !== "canary/latest.json");
65+
});
6666

6767
return c.json(
6868
{

apps/api/src/utils.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export async function getStars({
6565
}
6666
}
6767

68+
const CDN_URL = "https://artifacts.overlayed.dev";
69+
6870
export async function getPlatformDownloads({
6971
authToken,
7072
}: {
@@ -73,12 +75,20 @@ export async function getPlatformDownloads({
7375
// fetch all releases from github
7476
try {
7577
const releases = await getLatestRelease(authToken);
78+
const latestVersion = releases.tag_name.substring(1);
7679

77-
const versions = releases.assets
78-
.map((asset) => ({
79-
name: asset.name,
80-
url: asset.browser_download_url,
81-
platform: filenameToPlatform(asset.name),
80+
const versions = [
81+
{
82+
file: `Overlayed_${latestVersion}_amd64.AppImage`,
83+
platform: "linux",
84+
},
85+
{ file: `Overlayed_${latestVersion}_universal.dmg`, platform: "mac" },
86+
{ file: `Overlayed_${latestVersion}_x64_en-US.msi`, platform: "windows" },
87+
]
88+
.map((item) => ({
89+
name: `${item.file}`,
90+
url: `${CDN_URL}/stable/v${latestVersion}/${item.file}`,
91+
platform: item.platform,
8292
}))
8393
.filter((asset) => asset.name.match(/\.(dmg|msi|AppImage)$/));
8494

apps/web/plugins/proxy-middleware.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export default (paths) => {
3232
? createMockedProxy((pathname) => shouldFilterReq(paths, pathname))
3333
: createProxy((pathname) => shouldFilterReq(paths, pathname));
3434

35-
console.log(
36-
"[🌐 Mocked Proxy] Enabled, will resolve /latest/stable to /stable-mock.json",
37-
);
38-
3935
return {
4036
name: "proxy",
4137
hooks: {

0 commit comments

Comments
 (0)