diff options
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..fef4321 --- /dev/null +++ b/build.rs @@ -0,0 +1,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..10).unwrap_or(&build) + ); +} |