~starkingdoms/starkingdoms

ref: 1bcf5ed75103cbaa1b0ff71092b28c7e52aae2e3 starkingdoms/spacetime_rs/src/cmd.rs -rw-r--r-- 526 bytes
1bcf5ed7 — ghostlyzsh deleting all attached modules implemented 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use which::which;

pub fn enforce_commands() {
    println!("[spacetime] checking for required tooling");
    _enforce_command("cargo");
    _enforce_command("ninja");
    _enforce_command("yarn");
    _enforce_command("inkscape");
    _enforce_command("atlasify");
    println!("[spacetime] all required tools present");
}

fn _enforce_command(cmd: &str) {
    if which(cmd).is_err() {
        eprintln!(
            "[!] Unable to find required binary {}. Please install it to continue.",
            cmd
        );
    }
}