Skip to content

Commit

Permalink
Update dialoguer
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
  • Loading branch information
rylev committed Sep 23, 2024
1 parent 743ac8f commit aa4f43c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
18 changes: 3 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion crates/templates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions crates/templates/src/interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down Expand Up @@ -101,7 +101,7 @@ impl InteractionStrategy for Silent {
}
}

pub(crate) fn confirm(text: &str) -> std::io::Result<bool> {
pub(crate) fn confirm(text: &str) -> dialoguer::Result<bool> {
Confirm::new().with_prompt(text).interact()
}

Expand Down Expand Up @@ -130,9 +130,9 @@ pub(crate) fn prompt_parameter(parameter: &TemplateParameter) -> Option<String>

fn ask_free_text(prompt: &str, default_value: &Option<String>) -> anyhow::Result<String> {
let mut input = Input::<String>::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)
Expand Down

0 comments on commit aa4f43c

Please sign in to comment.