fix: macOS updater URL for different architectures (#69)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
Ryan Cao 2023-07-27 08:16:17 +08:00 committed by GitHub
parent 2b4f7a07d2
commit 9d62cc9437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,11 @@ ipcMain.handle(IpcEvents.UPDATER_DOWNLOAD, () => {
return portable ? !isSetup : isSetup;
})!.browser_download_url;
case "darwin":
return assets.find(a => a.name.endsWith(".dmg"))!.browser_download_url;
return assets.find(a =>
process.arch === "arm64"
? a.name.endsWith("-arm64-mac.zip")
: a.name.endsWith("-mac.zip") && !a.name.includes("arm64")
)!.browser_download_url;
case "linux":
return updateData.release.html_url;
default: