mirror of
https://github.com/SkyfallWasTaken/dinopkg.git
synced 2024-11-10 05:49:40 +00:00
Add confirmation to init
This commit is contained in:
parent
bf87587aae
commit
9b7fbcfc06
1 changed files with 11 additions and 1 deletions
|
@ -2,7 +2,7 @@ use std::env;
|
|||
|
||||
use camino::Utf8PathBuf;
|
||||
use color_eyre::Result;
|
||||
use dialoguer::{theme::ColorfulTheme, Input};
|
||||
use dialoguer::{theme::ColorfulTheme, Confirm, Input};
|
||||
use gix_config::File as GitConfigFile;
|
||||
|
||||
pub async fn init() -> Result<()> {
|
||||
|
@ -72,5 +72,15 @@ pub async fn init() -> Result<()> {
|
|||
license
|
||||
);
|
||||
|
||||
let yes = Confirm::with_theme(&ColorfulTheme::default())
|
||||
.with_prompt("Is this okay?")
|
||||
.default(true)
|
||||
.interact()?;
|
||||
if yes {
|
||||
println!("Writing.")
|
||||
} else {
|
||||
println!("Cancelled.")
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue