mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-17 00:47:12 +00:00
Split into objdiff-core / objdiff-gui; update egui to 0.26.2
This commit is contained in:
37
objdiff-gui/src/update.rs
Normal file
37
objdiff-gui/src/update.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
use cfg_if::cfg_if;
|
||||
use const_format::formatcp;
|
||||
use self_update::{cargo_crate_version, update::ReleaseUpdate};
|
||||
|
||||
pub const OS: &str = std::env::consts::OS;
|
||||
cfg_if! {
|
||||
if #[cfg(target_arch = "aarch64")] {
|
||||
cfg_if! {
|
||||
if #[cfg(any(windows, target_os = "macos"))] {
|
||||
pub const ARCH: &str = "arm64";
|
||||
} else {
|
||||
pub const ARCH: &str = std::env::consts::ARCH;
|
||||
}
|
||||
}
|
||||
} else if #[cfg(target_arch = "arm")] {
|
||||
pub const ARCH: &str = "armv7l";
|
||||
} else {
|
||||
pub const ARCH: &str = std::env::consts::ARCH;
|
||||
}
|
||||
}
|
||||
pub const GITHUB_USER: &str = "encounter";
|
||||
pub const GITHUB_REPO: &str = "objdiff";
|
||||
pub const BIN_NAME: &str =
|
||||
formatcp!("{}-{}-{}{}", GITHUB_REPO, OS, ARCH, std::env::consts::EXE_SUFFIX);
|
||||
pub const RELEASE_URL: &str =
|
||||
formatcp!("https://github.com/{}/{}/releases/latest", GITHUB_USER, GITHUB_REPO);
|
||||
|
||||
pub fn build_updater() -> self_update::errors::Result<Box<dyn ReleaseUpdate>> {
|
||||
self_update::backends::github::Update::configure()
|
||||
.repo_owner(GITHUB_USER)
|
||||
.repo_name(GITHUB_REPO)
|
||||
.bin_name(BIN_NAME)
|
||||
.no_confirm(true)
|
||||
.show_output(false)
|
||||
.current_version(cargo_crate_version!())
|
||||
.build()
|
||||
}
|
||||
Reference in New Issue
Block a user