Skip to content

Commit

Permalink
Auto merge of #1124 - pxdeu:fix/issue-916, r=Diggsey
Browse files Browse the repository at this point in the history
fixes prompt asking for msvc even though -y is provided

Fixes #916
no_prompt was simply not being checked
  • Loading branch information
bors committed May 21, 2017
2 parents 6d3d46b + ef36a24 commit 88c7217
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,15 @@ pub fn install(no_prompt: bool, verbose: bool,
try!(do_anti_sudo_check(no_prompt));

if !try!(do_msvc_check(&opts)) {
info!("aborting installation");
return Ok(());
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 88c7217

Please sign in to comment.