From a922eada049854019c5d1bbc82383f7095773e5c Mon Sep 17 00:00:00 2001 From: Jeidnx Date: Mon, 26 Aug 2024 16:31:22 +0200 Subject: [PATCH] bail when ask is rejected --- src/clean.rs | 2 +- src/home.rs | 2 +- src/nixos.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clean.rs b/src/clean.rs index 24bf21d..50518a7 100644 --- a/src/clean.rs +++ b/src/clean.rs @@ -201,7 +201,7 @@ impl NHRunnable for interface::CleanMode { if args.ask { info!("Confirm the cleanup plan?"); if !dialoguer::Confirm::new().default(false).interact()? { - return Ok(()); + bail!("User rejected the cleanup plan"); } } diff --git a/src/home.rs b/src/home.rs index fef0f0f..d87e610 100644 --- a/src/home.rs +++ b/src/home.rs @@ -136,7 +136,7 @@ impl HomeRebuildArgs { let confirmation = dialoguer::Confirm::new().default(false).interact()?; if !confirmation { - return Ok(()); + bail!("User rejected the new config"); } } diff --git a/src/nixos.rs b/src/nixos.rs index dfce8c5..32075d4 100644 --- a/src/nixos.rs +++ b/src/nixos.rs @@ -134,7 +134,7 @@ impl OsRebuildArgs { let confirmation = dialoguer::Confirm::new().default(false).interact()?; if !confirmation { - return Ok(()); + bail!("User rejected the new config"); } }