chore: Update release file names for different platforms

This commit is contained in:
Mauro Balades
2024-08-02 00:39:38 +02:00
parent 5dde47be3e
commit df8354f9da
2 changed files with 28 additions and 35 deletions

View File

@@ -92,7 +92,7 @@ export default function DownloadPage() {
const [linuxDownloadType, setLinuxDownloadType] = useState<string | null>(null); const [linuxDownloadType, setLinuxDownloadType] = useState<string | null>(null);
const [selectedPlatform, setSelectedPlatform] = useState(getDefaultPlatformBasedOnUserAgent()); const [selectedPlatform, setSelectedPlatform] = useState(getDefaultPlatformBasedOnUserAgent());
const [selectedArchitecture, setSelectedArchitecture] = useState("64-bit"); const [selectedArchitecture, setSelectedArchitecture] = useState("specific");
const [selectedWindowsDownloadType, setSelectedWindowsDownloadType] = useState("installer"); const [selectedWindowsDownloadType, setSelectedWindowsDownloadType] = useState("installer");
const [selectedLinuxDownloadType, setSelectedLinuxDownloadType] = useState("portable"); const [selectedLinuxDownloadType, setSelectedLinuxDownloadType] = useState("portable");
@@ -130,14 +130,7 @@ export default function DownloadPage() {
const startDownload = () => { const startDownload = () => {
const platform = releaseTree[selectedPlatform.toLowerCase()]; const platform = releaseTree[selectedPlatform.toLowerCase()];
let arch: string; let arch: string = selectedArchitecture;
if (selectedArchitecture === "64-bit") {
arch = "x64";
} else if (selectedArchitecture === "aarch64") {
arch = "arm";
} else {
arch = "x32";
}
let releaseTarget: string; let releaseTarget: string;
if (selectedPlatform === "MacOS") { if (selectedPlatform === "MacOS") {
releaseTarget = platform[arch]; releaseTarget = platform[arch];
@@ -148,7 +141,7 @@ export default function DownloadPage() {
} }
console.log("Downloading: "); console.log("Downloading: ");
console.log("platform: ", selectedPlatform); console.log("platform: ", selectedPlatform);
console.log("arch: ", arch); console.log("compat: ", arch);
setHasDownloaded(true); setHasDownloaded(true);
addDownload(releaseTarget); addDownload(releaseTarget);
window.location.replace(`${BASE_URL}/${releases[releaseTarget]}`); window.location.replace(`${BASE_URL}/${releases[releaseTarget]}`);
@@ -184,7 +177,7 @@ export default function DownloadPage() {
} }
const changeToFlatpak = () => { const changeToFlatpak = () => {
if (selectedArchitecture === "64-bit") { if (selectedArchitecture === "specific") {
setSelectedLinuxDownloadType("flatpak"); setSelectedLinuxDownloadType("flatpak");
} }
} }
@@ -254,14 +247,14 @@ export default function DownloadPage() {
<FieldTitle>Select Architecture</FieldTitle> <FieldTitle>Select Architecture</FieldTitle>
<FieldDescription>Choose the architecture of your device, either 32-bit or 64-bit.</FieldDescription> <FieldDescription>Choose the architecture of your device, either 32-bit or 64-bit.</FieldDescription>
<div className="flex items-center justify-center"> <div className="flex items-center justify-center">
<div onClick={() => 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" : "")}> <div onClick={() => 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" : "")}>
<h1 className="text-5xl my-2 opacity-40 dark:opacity-20">🚀</h1> <h1 className="text-5xl my-2 opacity-40 dark:opacity-20">🚀</h1>
<h1 className="text-2xl font-semibold my-2">64 Bits</h1> <h1 className="text-2xl font-semibold my-2">Optimized</h1>
<p className="text-muted-foreground mx-auto text-center">Blazing fast and compatible with modern devices</p> <p className="text-muted-foreground mx-auto text-center">Blazing fast and compatible with modern devices</p>
</div> </div>
<div onClick={() => 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" : "")}> <div onClick={() => 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" : "")}>
<h1 className="text-5xl my-2 opacity-40 dark:opacity-20">👴</h1> <h1 className="text-5xl my-2 opacity-40 dark:opacity-20">👴</h1>
<h1 className="text-2xl font-semibold my-2">32 Bits</h1> <h1 className="text-2xl font-semibold my-2">Generic</h1>
<p className="text-muted-foreground mx-auto text-center">Slow but compatible with older devices.</p> <p className="text-muted-foreground mx-auto text-center">Slow but compatible with older devices.</p>
</div> </div>
</div> </div>
@@ -275,12 +268,12 @@ export default function DownloadPage() {
<FieldTitle>Download Zen for MacOS</FieldTitle> <FieldTitle>Download Zen for MacOS</FieldTitle>
<FieldDescription>Click the button below to download Zen for MacOS.</FieldDescription> <FieldDescription>Click the button below to download Zen for MacOS.</FieldDescription>
<div className="flex items-center justify-center"> <div className="flex items-center justify-center">
<div onClick={() => 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" : "")}> <div onClick={() => 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" : "")}>
<h1 className="text-5xl my-2 opacity-40 dark:opacity-20">🍏</h1> <h1 className="text-5xl my-2 opacity-40 dark:opacity-20">🍏</h1>
<h1 className="text-2xl font-semibold my-2">aarch64</h1> <h1 className="text-2xl font-semibold my-2">aarch64</h1>
<p className="text-muted-foreground mx-auto text-center">64-bit ARM architecture, for Apple's M1 or M2 chips</p> <p className="text-muted-foreground mx-auto text-center">64-bit ARM architecture, for Apple's M1 or M2 chips</p>
</div> </div>
<div onClick={() => 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" : "")}> <div onClick={() => 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" : "")}>
<h1 className="text-5xl font-bold my-2 opacity-40 dark:opacity-20">x64</h1> <h1 className="text-5xl font-bold my-2 opacity-40 dark:opacity-20">x64</h1>
<h1 className="text-2xl font-semibold my-2">Intel</h1> <h1 className="text-2xl font-semibold my-2">Intel</h1>
<p className="text-muted-foreground mx-auto text-center">64-bit Intel architecture, for older Macs</p> <p className="text-muted-foreground mx-auto text-center">64-bit Intel architecture, for older Macs</p>

View File

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