Skip to content

Commit 5bc1c8c

Browse files
committed
Added environment variable RUSTUP_INIT_SKIP_CHECKING_EXISTENCE.
1 parent 680b2ed commit 5bc1c8c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/cli/self_update.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,16 @@ fn canonical_cargo_home() -> Result<String> {
235235
/// `CARGO_HOME`/bin, hard-linking the various Rust tools to it,
236236
/// and adding `CARGO_HOME`/bin to PATH.
237237
pub fn install(no_prompt: bool, verbose: bool, quiet: bool, mut opts: InstallOpts) -> Result<()> {
238-
do_pre_install_sanity_checks(no_prompt)?;
238+
if !env::var_os("RUSTUP_INIT_SKIP_EXISTENCE_CHECKS").map_or(false, |s| s == "yes") {
239+
do_pre_install_sanity_checks(no_prompt)?;
240+
}
241+
239242
do_pre_install_options_sanity_checks(&opts)?;
240-
check_existence_of_rustc_or_cargo_in_path(no_prompt)?;
243+
244+
if !env::var_os("RUSTUP_INIT_SKIP_EXISTENCE_CHECKS").map_or(false, |s| s == "yes") {
245+
check_existence_of_rustc_or_cargo_in_path(no_prompt)?;
246+
}
247+
241248
#[cfg(unix)]
242249
do_anti_sudo_check(no_prompt)?;
243250

0 commit comments

Comments
 (0)