You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
339 B
11 lines
339 B
5 years ago
|
use std::process::Command;
|
||
5 years ago
|
use std::str;
|
||
5 years ago
|
|
||
|
fn main() {
|
||
|
let git_rev = match Command::new("git").args(&["rev-parse", "HEAD"]).output() {
|
||
5 years ago
|
Ok(output) => str::from_utf8(&output.stdout).unwrap().trim().to_string(),
|
||
|
Err(_) => env!("CARGO_PKG_VERSION").to_string(),
|
||
5 years ago
|
};
|
||
|
println!("cargo:rustc-env=GIT_REV={}", git_rev);
|
||
|
}
|