fix: interrupt inquire to exit

This commit is contained in:
iff 2025-01-07 11:47:16 +01:00
parent 7a45532802
commit 050a71a502
3 changed files with 6 additions and 2 deletions

View file

@ -155,7 +155,7 @@ pub fn cnf(data: &mut Data) {
.with_render_config(render_config)
.without_filtering()
.prompt()
.unwrap();
.unwrap_or_else(|_| std::process::exit(1));
// retry after installing package
if system::install_package(data, &package_manager, &package) {

View file

@ -131,7 +131,7 @@ pub fn select_candidate(data: &mut Data) {
.without_help_message()
.with_render_config(render_config)
.prompt()
.unwrap();
.unwrap_or_else(|_| exit(1));
let pos = highlight_candidates.iter().position(|x| x == &ans).unwrap();
let suggestion = candidates[pos].to_string();
data.update_suggest(&suggestion);