Exit 0 if the user presses Ctrl+d when prompted for db name

This commit is contained in:
Joseph Ferano 2023-06-08 17:37:04 +07:00
parent 6e5dcebc2e
commit db92090916

View File

@ -45,6 +45,7 @@ fn prompt_project_init(default_name: &str) -> (String, io::Result<File>) {
let filename = let filename =
match result { match result {
Ok(b) if b == 0 => std::process::exit(0),
Ok(b) if b > 0 && !input.is_empty() => input, Ok(b) if b > 0 && !input.is_empty() => input,
_ => default_name _ => default_name
}; };