bootc_internal_utils/
lib.rs1mod bwrap;
6pub use bwrap::*;
7mod command;
8pub use command::*;
9mod iterators;
10pub use iterators::*;
11mod path;
12pub use path::*;
13pub mod reexec;
15mod result_ext;
16pub use result_ext::*;
17mod timestamp;
18pub use timestamp::*;
19mod tracing_util;
20pub use tracing_util::*;
21
22pub const NAME: &str = "bootc";
24
25pub fn run_main<F>(f: F)
28where
29 F: FnOnce() -> anyhow::Result<()>,
30{
31 use std::io::Write as _;
32
33 use owo_colors::OwoColorize;
34
35 if let Err(e) = f() {
36 let mut stderr = anstream::stderr();
37 let _ = writeln!(stderr, "{}{:#}", "error: ".red(), e);
39 std::process::exit(1);
40 }
41}