diff --git a/Cargo.lock b/Cargo.lock index 2695c1d41..7ea514dbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,9 +216,8 @@ dependencies = [ [[package]] name = "axoupdater" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb8d8889305a413a040f281197bb2f8982a1d25c9696707cab350e3cc780ba5" +version = "0.8.2" +source = "git+https://github.com/axodotdev/axoupdater?rev=18bcd3e8937f05c24dec786860641f77e7931523#18bcd3e8937f05c24dec786860641f77e7931523" dependencies = [ "axoasset", "axoprocess", @@ -230,7 +229,7 @@ dependencies = [ "self-replace", "serde", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.6", "url", ] diff --git a/Cargo.toml b/Cargo.toml index bfb3a2697..5a78936f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ axoproject = { version = "=0.26.1", path = "axoproject", default-features = fals # first-party deps axocli = { version = "0.2.0" } -axoupdater = { version = "0.8.1" } +axoupdater = { git = "https://github.com/axodotdev/axoupdater", rev = "18bcd3e8937f05c24dec786860641f77e7931523" } axotag = "0.2.0" axoasset = { version = "1.2.0", features = ["json-serde", "toml-serde", "toml-edit", "yaml-serde", "compression", "remote"] } axoprocess = { version = "0.2.0" } diff --git a/cargo-dist/src/main.rs b/cargo-dist/src/main.rs index 140ef1484..c7c088b9f 100644 --- a/cargo-dist/src/main.rs +++ b/cargo-dist/src/main.rs @@ -729,7 +729,7 @@ async fn cmd_update(_config: &Cli, args: &cli::UpdateArgs) -> Result<(), miette: return Ok(()); } - let mut updater = AxoUpdater::new_for("cargo-dist"); + let mut updater = AxoUpdater::new_for("dist"); // If there's a specific version needed, random-access query it by tag, // because we always use the same tag format and this is fastest while @@ -759,12 +759,19 @@ async fn cmd_update(_config: &Cli, args: &cli::UpdateArgs) -> Result<(), miette: updater.set_github_token(&token); } - // Do we want to treat this as an error? - // Or do we want to sniff if this was a Homebrew installation? - if updater.load_receipt().is_err() { - eprintln!("Unable to load install receipt to check for updates."); - eprintln!("If you installed this via `brew`, please `brew upgrade cargo-dist`!"); - return Ok(()); + // First, try to check for a "dist" receipt + // (this might be a post-rename release) + if updater.load_receipt_as("dist").is_err() { + // If that didn't work, try again as "cargo-dist" + if updater + .load_receipt_as("cargo-dist") + .map(|updater| updater.set_name("dist")) + .is_err() + { + eprintln!("Unable to load install receipt to check for updates."); + eprintln!("If you installed this via `brew`, please `brew upgrade cargo-dist`!"); + return Ok(()); + } } if !updater.check_receipt_is_for_this_executable()? { diff --git a/cargo-dist/tests/cli-tests.rs b/cargo-dist/tests/cli-tests.rs index 6da035279..da73d89b2 100644 --- a/cargo-dist/tests/cli-tests.rs +++ b/cargo-dist/tests/cli-tests.rs @@ -267,6 +267,7 @@ fn generate_installer(version: &axotag::Version, release_type: ReleaseSourceType } #[test] +#[ignore = "can't be reenabled until after the rename"] fn test_self_update() { // Only do this if RUIN_MY_COMPUTER_WITH_INSTALLERS is set if std::env::var(ENV_RUIN_ME)