From df8354f9da56cb81135f5d8cae7e018b0b3bed5c Mon Sep 17 00:00:00 2001 From: Mauro Balades Date: Fri, 2 Aug 2024 00:39:38 +0200 Subject: [PATCH] chore: Update release file names for different platforms --- src/components/download.tsx | 27 ++++++++++----------------- src/lib/releases.ts | 36 ++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/src/components/download.tsx b/src/components/download.tsx index 1d0588f..0fa3305 100644 --- a/src/components/download.tsx +++ b/src/components/download.tsx @@ -92,7 +92,7 @@ export default function DownloadPage() { const [linuxDownloadType, setLinuxDownloadType] = useState(null); const [selectedPlatform, setSelectedPlatform] = useState(getDefaultPlatformBasedOnUserAgent()); - const [selectedArchitecture, setSelectedArchitecture] = useState("64-bit"); + const [selectedArchitecture, setSelectedArchitecture] = useState("specific"); const [selectedWindowsDownloadType, setSelectedWindowsDownloadType] = useState("installer"); const [selectedLinuxDownloadType, setSelectedLinuxDownloadType] = useState("portable"); @@ -130,14 +130,7 @@ export default function DownloadPage() { const startDownload = () => { const platform = releaseTree[selectedPlatform.toLowerCase()]; - let arch: string; - if (selectedArchitecture === "64-bit") { - arch = "x64"; - } else if (selectedArchitecture === "aarch64") { - arch = "arm"; - } else { - arch = "x32"; - } + let arch: string = selectedArchitecture; let releaseTarget: string; if (selectedPlatform === "MacOS") { releaseTarget = platform[arch]; @@ -148,7 +141,7 @@ export default function DownloadPage() { } console.log("Downloading: "); console.log("platform: ", selectedPlatform); - console.log("arch: ", arch); + console.log("compat: ", arch); setHasDownloaded(true); addDownload(releaseTarget); window.location.replace(`${BASE_URL}/${releases[releaseTarget]}`); @@ -184,7 +177,7 @@ export default function DownloadPage() { } const changeToFlatpak = () => { - if (selectedArchitecture === "64-bit") { + if (selectedArchitecture === "specific") { setSelectedLinuxDownloadType("flatpak"); } } @@ -254,14 +247,14 @@ export default function DownloadPage() { Select Architecture Choose the architecture of your device, either 32-bit or 64-bit.
-
setSelectedArchitecture("64-bit")} className={ny("select-none w-full h-full mb-2 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "64-bit" ? "border-blue-400" : "")}> +
setSelectedArchitecture("specific")} className={ny("select-none w-full h-full mb-2 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "64-bit" ? "border-blue-400" : "")}>

🚀

-

64 Bits

+

Optimized

Blazing fast and compatible with modern devices

-
setSelectedArchitecture("32-bit")} className={ny("select-none w-full h-full mb-2 ml-10 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "32-bit" ? "border-blue-400" : "")}> +
setSelectedArchitecture("generic")} className={ny("select-none w-full h-full mb-2 ml-10 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "32-bit" ? "border-blue-400" : "")}>

👴

-

32 Bits

+

Generic

Slow but compatible with older devices.

@@ -275,12 +268,12 @@ export default function DownloadPage() { Download Zen for MacOS Click the button below to download Zen for MacOS.
-
setSelectedArchitecture("aarch64")} className={ny("select-none w-full h-full mb-2 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "aarch64" ? "border-blue-400" : "")}> +
setSelectedArchitecture("specific")} className={ny("select-none w-full h-full mb-2 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "aarch64" ? "border-blue-400" : "")}>

🍏

aarch64

64-bit ARM architecture, for Apple's M1 or M2 chips

-
setSelectedArchitecture("64-bit")} className={ny("select-none w-full h-full mb-2 ml-10 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "64-bit" ? "border-blue-400" : "")}> +
setSelectedArchitecture("generic")} className={ny("select-none w-full h-full mb-2 ml-10 p-5 flex flex-col items-center rounded-lg bg-background cursor-pointer border", selectedArchitecture === "64-bit" ? "border-blue-400" : "")}>

x64

Intel

64-bit Intel architecture, for older Macs

diff --git a/src/lib/releases.ts b/src/lib/releases.ts index 3bee523..dea6041 100644 --- a/src/lib/releases.ts +++ b/src/lib/releases.ts @@ -1,18 +1,18 @@ export const releases: any = { - WindowsInstaller: "zen.installer-x64.exe", - WindowsInstaller32: "zen.installer-x32.exe", + WindowsInstaller: "zen.installer.exe", + WindowsInstallerGeneric: "zen.installer-generic.exe", - WindowsZip: "zen.win-x64.zip", - WindowsZip32: "zen.win-x32.zip", + WindowsZip: "zen.win-specific.zip", + WindowsZipGeneric: "zen.win-generic.zip", MacOS: "zen.macos-aarch64.dmg", MacOSIntel: "zen.macos-x64.dmg", - Linux: "zen.linux-x64.tar.bz2", - Linux32: "zen.linux-x32.tar.bz2", + Linux: "zen.linux-specific.tar.bz2", + LinuxGeneric: "zen.linux-generic.tar.bz2", - LinuxAppImage: "zen-x64.AppImage", - LinuxAppImage32: "zen-x32.AppImage", + LinuxAppImage: "zen-specific.AppImage", + LinuxAppImageGeneric: "zen-generic.AppImage", }; // platform @@ -20,27 +20,27 @@ export const releases: any = { // -> file export const releaseTree: any = { windows: { - x64: { + specific: { installer: "WindowsInstaller", portable: "WindowsZip", }, - x32: { - installer: "WindowsInstaller32", - portable: "WindowsZip32", + generic: { + installer: "WindowsInstallerGeneric", + portable: "WindowsZipGeneric", }, }, macos: { - x64: "MacOSIntel", - arm: "MacOS", + generic: "MacOSIntel", + specific: "MacOS", }, linux: { - x64: { + specific: { portable: "Linux", appimage: "LinuxAppImage", }, - x32: { - portable: "Linux32", - appimage: "LinuxAppImage32", + generic: { + portable: "LinuxGeneric", + appimage: "LinuxAppImageGeneric", }, }, };