~starkingdoms/starkingdoms

ref: 1d8e8904f83c603ee05022ab934af06401066f16 starkingdoms/spacetime_rs/src/cmd.rs -rw-r--r-- 526 bytes
1d8e8904 — ghostlyzsh rotation bug vanquished, but preattached modules still exist (please remove) 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
        );
    }
}