This commit is contained in:
JMARyA 2024-12-28 05:14:29 +01:00
parent 17a137e47c
commit 4a70ffa906
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
6 changed files with 49 additions and 21 deletions

View file

@ -16,12 +16,16 @@ fn is_root() -> bool {
getuid() == Uid::from_raw(0)
}
fn run_command(cmd: &[String], input: Option<&str>, inherit: bool) -> (String, String) {
fn print_status(msg: &str) {
println!(
"{} {}",
"-->".paint(Color::Red),
cmd.join(" ").paint(Color::Blue.bold())
msg.paint(Color::Blue.bold())
);
}
fn run_command(cmd: &[String], input: Option<&str>, inherit: bool) -> (String, String) {
print_status(&cmd.join(" "));
let mut cmd_setup = std::process::Command::new(cmd[0].clone());
let mut cmd_setup = cmd_setup.args(cmd.into_iter().skip(1).collect::<Vec<_>>());