enwiro 0.3.35

Simplify your workflow with dedicated project environments for each workspace in your window manager
1
2
3
4
5
6
7
8
9
10
11
use std::io::{self, IsTerminal};

pub fn confirm(prompt: &str) -> anyhow::Result<bool> {
    if !io::stdin().is_terminal() {
        anyhow::bail!("cannot prompt for confirmation (stdin is not a tty); pass -y to confirm");
    }
    Ok(dialoguer::Confirm::new()
        .with_prompt(prompt)
        .default(false)
        .interact()?)
}