Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed May 23, 2021
1 parent fddbc2e commit 338f0bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/src/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ variable. This setting supports three values: `enable` and `disable` and `check
* `enable` will mean that `rustup update` and similar commands will also check-for, and install, any update to Rustup.
* `check-only` will cause any automatic self update to check and report on any updates, but not to automatically install them.

Whether automatic self-update is enabled or not, you can request that Rustup check for, and update it self to the
Whether automatic self-update is enabled or not, you can request that Rustup check for, and update itself to the
latest version of `rustup` without updating any installed toolchains by running `rustup
self update`:

Expand All @@ -49,7 +49,8 @@ info: checking for self-updates
info: downloading self-updates
```

**Note**: If auto-self-update is `enable`, `rustup` will automatically update itself at the end of any
### Disable automatic self-updates with the parameter of the command
If auto-self-update is `enable`, `rustup` will automatically update itself at the end of any
toolchain installation as well. You can prevent this automatic behaviour by
passing the `--no-self-update` argument when running `rustup update` or
`rustup toolchain install`.
Expand Down
3 changes: 3 additions & 0 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,9 @@ fn set_profile(cfg: &mut Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
}

fn set_auto_self_update(cfg: &mut Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
if self_update::NEVER_SELF_UPDATE {
writeln!(process().stdout(), "Your rustup is built with the no-self-update feature, so setting auto-self-update will not have any effect.")?;
}
cfg.set_auto_self_update(&m.value_of("auto-self-update-mode").unwrap())?;
Ok(utils::ExitCode(0))
}
Expand Down

0 comments on commit 338f0bd

Please sign in to comment.