Skip to content

Commit

Permalink
allow users to override the existing configuration during x setup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
onur-ozkan committed Nov 9, 2023
1 parent 3d6417f commit 42fbf3e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/bootstrap/src/core/build_steps/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 42fbf3e

Please sign in to comment.