lilo-rm-core 0.2.0

Runtime Matters core protocol types and JSON line wire contract for rtmd clients
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::process::Command;

fn main() {
    println!("cargo:rerun-if-changed=../../.git/HEAD");
    let sha = Command::new("git")
        .args(["rev-parse", "--short=12", "HEAD"])
        .output()
        .ok()
        .filter(|output| output.status.success())
        .and_then(|output| String::from_utf8(output.stdout).ok())
        .map(|value| value.trim().to_owned())
        .filter(|value| !value.is_empty())
        .unwrap_or_else(|| "unknown".to_owned());
    println!("cargo:rustc-env=RTM_GIT_SHA={sha}");
}