1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-03-21 04:30:53 +00:00

17 lines
372 B
Rust

use std::process::Command;
fn main() {
let rev = Command::new("git")
.arg("rev-parse")
.arg("HEAD")
.output()
.ok()
.map(|s| s.stdout)
.and_then(|s| String::from_utf8(s).ok());
if let Some(rev) = rev {
if rev.len() >= 9 {
println!("cargo:rustc-env=WBG_VERSION={}", &rev[..9]);
}
}
}