about summary refs log tree commit diff
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2023-11-08 13:17:58 +0300
committeronur-ozkan <work@onurozkan.dev>2023-11-09 09:21:38 +0300
commit42fbf3ebf5a6ac9d976e52b4ea63081d19dba9dc (patch)
tree7d7fd17d20a04a8ed9e337a44d88860eaa119c51
parent3d6417fc7a117c36195f45d1d5e30a43fc5365ab (diff)
downloadrust-42fbf3ebf5a6ac9d976e52b4ea63081d19dba9dc.tar.gz
rust-42fbf3ebf5a6ac9d976e52b4ea63081d19dba9dc.zip
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 <work@onurozkan.dev>
-rw-r--r--src/bootstrap/src/core/build_steps/setup.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/build_steps/setup.rs b/src/bootstrap/src/core/build_steps/setup.rs
index f29f9873d2a..ae2b1233313 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