Download gpgui from latest tag

This commit is contained in:
Kevin Yue 2024-02-25 23:31:35 +08:00
parent 3617dd990b
commit 0a26d6e360

View File

@ -80,14 +80,19 @@ impl GuiUpdater {
pub async fn update(&self) {
info!("Update GUI, version: {}", self.version);
#[cfg(debug_assertions)]
let release_tag = "latest";
#[cfg(not(debug_assertions))]
let release_tag = format!("v{}", self.version);
#[cfg(target_arch = "x86_64")]
let arch = "x86_64";
#[cfg(target_arch = "aarch64")]
let arch = "aarch64";
let file_url = format!(
"https://github.com/yuezk/GlobalProtect-openconnect/releases/download/v{}/gpgui_{}_{}.bin.tar.xz",
self.version, self.version, arch
"https://github.com/yuezk/GlobalProtect-openconnect/releases/download/{}/gpgui_{}_{}.bin.tar.xz",
release_tag, self.version, arch
);
let checksum_url = format!("{}.sha256", file_url);