diff --git a/binaries/cli/Cargo.toml b/binaries/cli/Cargo.toml index a6fc43d7..6496e4ef 100644 --- a/binaries/cli/Cargo.toml +++ b/binaries/cli/Cargo.toml @@ -50,7 +50,12 @@ tabwriter = "1.4.0" log = { version = "0.4.21", features = ["serde"] } colored = "2.1.0" env_logger = "0.11.3" -self_update = { version = "0.27.0", features = ["rustls", "archive-zip"], default-features = false } +self_update = { version = "0.27.0", features = [ + "rustls", + "archive-zip", + "archive-tar", + "compression-flate2", +], default-features = false } pyo3 = { workspace = true, features = [ "extension-module", "abi3", diff --git a/binaries/cli/build.rs b/binaries/cli/build.rs new file mode 100644 index 00000000..81caa36d --- /dev/null +++ b/binaries/cli/build.rs @@ -0,0 +1,6 @@ +fn main() { + println!( + "cargo:rustc-env=TARGET={}", + std::env::var("TARGET").unwrap() + ); +} diff --git a/binaries/cli/src/lib.rs b/binaries/cli/src/lib.rs index ac1d4c1d..58c77c3a 100644 --- a/binaries/cli/src/lib.rs +++ b/binaries/cli/src/lib.rs @@ -555,9 +555,17 @@ fn run(args: Args) -> eyre::Result<()> { SelfSubCommand::Update { check_only } => { println!("Checking for updates..."); + #[cfg(target_os = "linux")] + let bin_path_in_archive = format!("dora-cli-{}/dora", env!("TARGET")); + #[cfg(target_os = "macos")] + let bin_path_in_archive = format!("dora-cli-{}/dora", env!("TARGET")); + #[cfg(target_os = "windows")] + let bin_path_in_archive = String::from("dora.exe"); + let status = self_update::backends::github::Update::configure() .repo_owner("dora-rs") .repo_name("dora") + .bin_path_in_archive(&bin_path_in_archive) .bin_name("dora") .show_download_progress(true) .current_version(env!("CARGO_PKG_VERSION"))