summaryrefslogtreecommitdiffstats
path: root/build.rs
blob: 19eff113046899eac0c4ca1dfacf22eb7bf43ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::process::Command;

fn main() {
    let build = String::from_utf8_lossy(
        &Command::new("git")
            .args(&["rev-parse", "HEAD"])
            .output()
            .unwrap()
            .stdout,
    )
    .to_string();
    println!(
        "cargo:rustc-env=DWVSH_BUILD={}",
        build.get(0..7).unwrap_or(&build)
    );
}