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 753c3b666..a2c7a3f19 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)