diff --git a/CHANGELOG.md b/CHANGELOG.md index c40a489..edce902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- `elan install`/`elan toolchain install` now report an already-installed toolchain as such and exit with code 0 instead of failing with `'...' is already installed`. - Fix panic in `elan toolchain gc` when a toolchain directory listed in `~/.elan/toolchains` does not resolve to an existing directory, e.g. after deleting a toolchain manually. # 4.2.3 - 2026-06-08 diff --git a/src/elan-cli/elan_mode.rs b/src/elan-cli/elan_mode.rs index b8697bb..8897018 100644 --- a/src/elan-cli/elan_mode.rs +++ b/src/elan-cli/elan_mode.rs @@ -264,11 +264,14 @@ fn install(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<()> { let desc = lookup_toolchain_desc(cfg, name)?; let toolchain = cfg.get_toolchain(&desc, false)?; - if !toolchain.exists() || !toolchain.is_custom() { - toolchain.install_from_dist()?; - println!(); - common::show_channel_update(cfg, &toolchain.desc)?; + if toolchain.exists() { + info!("toolchain '{}' is already installed", toolchain.desc); + continue; } + + toolchain.install_from_dist()?; + println!(); + common::show_channel_update(cfg, &toolchain.desc)?; } Ok(())