Skip to content

Commit

Permalink
always performing the check, printing a warning if it is not installe…
Browse files Browse the repository at this point in the history
…d and -y passed
  • Loading branch information
pxdeu committed May 21, 2017
1 parent b6b74fb commit ef36a24
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,16 @@ pub fn install(no_prompt: bool, verbose: bool,
try!(do_pre_install_sanity_checks());
try!(do_anti_sudo_check(no_prompt));

if !no_prompt && !try!(do_msvc_check(&opts)) {
info!("aborting installation");
return Ok(());
if !try!(do_msvc_check(&opts)) {
if no_prompt {
warn!("installing msvc toolchain without its prerequisites");
} else {
term2::stdout().md(MSVC_MESSAGE);
if !try!(common::confirm("\nContinue? (Y/n)", true)) {
info!("aborting installation");
return Ok(());
}
}
}

if !no_prompt {
Expand Down Expand Up @@ -463,10 +470,7 @@ fn do_msvc_check(opts: &InstallOpts) -> Result<bool> {
let installing_msvc = opts.default_host_triple.contains("msvc");
let have_msvc = windows_registry::find_tool(&opts.default_host_triple, "cl.exe").is_some();
if installing_msvc && !have_msvc {
term2::stdout().md(MSVC_MESSAGE);
if !try!(common::confirm("\nContinue? (Y/n)", true)) {
return Ok(false);
}
return Ok(false);
}

Ok(true)
Expand Down

0 comments on commit ef36a24

Please sign in to comment.