intermodal/build.rs

13 lines
313 B
Rust
Raw Normal View History

2019-05-24 10:25:55 +02:00
use std::{error::Error, process::Command, str};
fn main() -> Result<(), Box<dyn Error>> {
let stdout = Command::new("git")
.arg("rev-parse")
.arg("HEAD")
.output()?
.stdout;
let hash = str::from_utf8(&stdout)?;
println!("cargo:rustc-env=GIT_HEAD_PARTIAL_HASH={}", &hash[0..12]);
Ok(())
}