Skip to content

Commit bb4d4ed

Browse files
committed
feat(rustup-mode): add no_update flag to rustup toolchain install
1 parent 6496be0 commit bb4d4ed

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/cli/rustup_mode.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ struct UpdateOpts {
378378
#[arg(long)]
379379
no_self_update: bool,
380380

381+
/// Don't try to update the installed toolchain
382+
#[arg(long)]
383+
no_update: bool,
384+
381385
/// Force an update, even if some components are missing
382386
#[arg(long)]
383387
force: bool,
@@ -967,8 +971,12 @@ async fn update(
967971
let profile = cfg.get_profile()?;
968972
let status = match DistributableToolchain::new(cfg, desc.clone()) {
969973
Ok(mut d) => {
970-
d.update_extra(&components, &targets, profile, force, allow_downgrade)
971-
.await?
974+
if !opts.no_update {
975+
d.update_extra(&components, &targets, profile, force, allow_downgrade)
976+
.await?
977+
} else {
978+
UpdateStatus::Unchanged
979+
}
972980
}
973981
Err(RustupError::ToolchainNotInstalled { .. }) => {
974982
DistributableToolchain::install(

0 commit comments

Comments
 (0)