diff --git a/Cargo.lock b/Cargo.lock index 02d7f38b7..b58be5c88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1854,18 +1854,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "dialoguer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" -dependencies = [ - "console", - "shell-words", - "tempfile", - "zeroize", -] - [[package]] name = "dialoguer" version = "0.11.0" @@ -6969,7 +6957,7 @@ dependencies = [ "conformance", "conformance-tests", "ctrlc", - "dialoguer 0.10.4", + "dialoguer", "dirs 5.0.1", "futures", "glob", @@ -7769,7 +7757,7 @@ dependencies = [ "async-trait", "bytes", "console", - "dialoguer 0.10.4", + "dialoguer", "dirs 5.0.1", "fs_extra", "heck 0.5.0", @@ -9093,7 +9081,7 @@ dependencies = [ "async-trait", "bytes", "clap 4.5.4", - "dialoguer 0.11.0", + "dialoguer", "dirs 5.0.1", "futures-util", "indexmap 2.5.0", diff --git a/Cargo.toml b/Cargo.toml index 78a8ae3d5..c150ff12c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ clearscreen = "3" comfy-table = "7" command-group = "2" ctrlc = { version = "3.4", features = ["termination"] } -dialoguer = "0.10" +dialoguer = "0.11" dirs = { workspace = true } futures = { workspace = true } glob = { workspace = true } diff --git a/crates/templates/Cargo.toml b/crates/templates/Cargo.toml index b6574c6b8..9146af0b2 100644 --- a/crates/templates/Cargo.toml +++ b/crates/templates/Cargo.toml @@ -9,7 +9,7 @@ anyhow = { workspace = true } async-trait = { workspace = true } bytes = { workspace = true } console = "0.15" -dialoguer = "0.10" +dialoguer = "0.11" dirs = { workspace = true } fs_extra = "1" heck = "0.5" diff --git a/crates/templates/src/interaction.rs b/crates/templates/src/interaction.rs index a8d36abae..50025ec38 100644 --- a/crates/templates/src/interaction.rs +++ b/crates/templates/src/interaction.rs @@ -48,7 +48,7 @@ impl InteractionStrategy for Interactive { match crate::interaction::confirm(&prompt) { Ok(true) => Cancellable::Ok(()), Ok(false) => Cancellable::Cancelled, - Err(e) => Cancellable::Err(anyhow::Error::from(e)), + Err(e) => Cancellable::Err(e.into()), } } else { Cancellable::Ok(()) @@ -101,7 +101,7 @@ impl InteractionStrategy for Silent { } } -pub(crate) fn confirm(text: &str) -> std::io::Result { +pub(crate) fn confirm(text: &str) -> dialoguer::Result { Confirm::new().with_prompt(text).interact() } @@ -130,9 +130,9 @@ pub(crate) fn prompt_parameter(parameter: &TemplateParameter) -> Option fn ask_free_text(prompt: &str, default_value: &Option) -> anyhow::Result { let mut input = Input::::new(); - input.with_prompt(prompt); + input = input.with_prompt(prompt); if let Some(s) = default_value { - input.default(s.to_owned()); + input = input.default(s.to_owned()); } let result = input.interact_text()?; Ok(result)