From 1f9bbd8b3fadd90589e8bcefa7216138f7d6aca8 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 8 Nov 2023 13:17:58 +0300 Subject: [PATCH] allow users to override the existing configuration during x setup Instead of immediately terminating bootstrap, users are now given the option to decide whether they want to override the file or leave it unchanged. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/setup.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/setup.rs b/src/bootstrap/src/core/build_steps/setup.rs index 47bd7918bd05..616c807c1263 100644 --- a/src/bootstrap/src/core/build_steps/setup.rs +++ b/src/bootstrap/src/core/build_steps/setup.rs @@ -130,7 +130,17 @@ impl Step for Profile { t!(path.canonicalize()).display() ); - crate::exit!(1); + match prompt_user( + "Do you wish to override the existing configuration (which will allow the setup process to continue)?: [y/N]", + ) { + Ok(Some(PromptResult::Yes)) => { + t!(fs::remove_file(path)); + } + _ => { + println!("Exiting."); + crate::exit!(1); + } + } } // for Profile, `run.paths` will have 1 and only 1 element