mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-21 02:11:01 +00:00
display the git revision version information (#105)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fn main() {
|
||||
let git_rev = std::process::Command::new("git")
|
||||
.args(["rev-parse", "--short", "HEAD"])
|
||||
.output()
|
||||
.map(|out| String::from_utf8(out.stdout).unwrap_or_default())
|
||||
.unwrap_or("unknown".to_owned());
|
||||
|
||||
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_rev.trim());
|
||||
}
|
||||
Reference in New Issue
Block a user