Skip to content

Commit 18c32d9

Browse files
brettearledjc
authored andcommitted
fix ambiguous prompt after setting up custom installation
1 parent 8ff2ec4 commit 18c32d9

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/cli/common.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ pub(crate) enum Confirm {
5656
Advanced,
5757
}
5858

59-
pub(crate) fn confirm_advanced() -> Result<Confirm> {
59+
pub(crate) fn confirm_advanced(customized_install: bool) -> Result<Confirm> {
6060
writeln!(process().stdout().lock())?;
61-
writeln!(
62-
process().stdout().lock(),
63-
"1) Proceed with installation (default)"
64-
)?;
61+
let first_option = match customized_install {
62+
true => "1) Proceed with selected options (default - just press enter)",
63+
false => "1) Proceed with standard installation (default - just press enter)",
64+
};
65+
writeln!(process().stdout().lock(), "{first_option}")?;
6566
writeln!(process().stdout().lock(), "2) Customize installation")?;
6667
writeln!(process().stdout().lock(), "3) Cancel installation")?;
6768
write!(process().stdout().lock(), ">")?;

src/cli/self_update.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ pub(crate) fn install(
433433
let msg = pre_install_msg(opts.no_modify_path)?;
434434

435435
md(&mut term, msg);
436-
436+
let mut customized_install = false;
437437
loop {
438438
md(&mut term, current_install_opts(&opts));
439-
match common::confirm_advanced()? {
439+
match common::confirm_advanced(customized_install)? {
440440
Confirm::No => {
441441
info!("aborting installation");
442442
return Ok(utils::ExitCode(0));
@@ -445,6 +445,7 @@ pub(crate) fn install(
445445
break;
446446
}
447447
Confirm::Advanced => {
448+
customized_install = true;
448449
opts = customize_install(opts)?;
449450
}
450451
}

tests/suite/cli_inst_interactive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Current installation options:
9090
profile: default
9191
modify PATH variable: no
9292
93-
1) Proceed with installation (default)
93+
1) Proceed with standard installation (default - just press enter)
9494
2) Customize installation
9595
3) Cancel installation
9696
>

0 commit comments

Comments
 (0)