cargo-crapapp 0.4.2

Cargo subcommand for building CRAP app installers and self-contained app bundles
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Runs work with stable terminal output.
///
/// Do not redraw this line: cargo commands can take minutes and many terminals
/// render carriage-return spinners as distracting flicker.
pub fn run<T, E, F>(message: &str, work: F) -> Result<T, E>
where
    F: FnOnce() -> Result<T, E>,
{
    eprintln!("{message}...");
    let result = work();
    let status = if result.is_ok() { "done" } else { "failed" };
    eprintln!("{message} {status}");
    result
}