cargo_auto_local_lib/
utils_mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
// utils_mod.rs

//! Functions for various utilities.

/// Run one shell command and return true if success.
pub fn run_shell_command_success(shell_command: &str) -> bool {
    if !shell_command.starts_with("echo ") && !shell_command.starts_with("printf ") {
        println!("    $ {}", shell_command);
    }
    let status = std::process::Command::new("sh").arg("-c").arg(shell_command).status().unwrap();
    // return
    status.success()
}