fontlift-cli 5.0.10

CLI interface for fontlift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    let version = std::process::Command::new("git")
        .args(["describe", "--tags", "--always"])
        .output()
        .ok()
        .filter(|o| o.status.success())
        .and_then(|o| String::from_utf8(o.stdout).ok())
        .map(|s| s.trim().trim_start_matches('v').to_string())
        .unwrap_or_else(|| {
            std::env::var("CARGO_PKG_VERSION").unwrap_or_else(|_| "unknown".into())
        });

    println!("cargo:rustc-env=GIT_VERSION={version}");
    // Rebuild when HEAD or tags change
    println!("cargo:rerun-if-changed=../.git/HEAD");
    println!("cargo:rerun-if-changed=../.git/refs/tags");
}