~starkingdoms/starkingdoms

ref: dd101bc47e02b050cc85e160450af537e601d8fe starkingdoms/spacetime_rs/src/cmd.rs -rw-r--r-- 491 bytes
dd101bc4 — core whoa, i just rewrote spacetime again 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
    }
}