Use GIT_HASH for network identifier
This commit is contained in:
parent
64d8c148ce
commit
d3c6602901
11
rust/build.rs
Normal file
11
rust/build.rs
Normal file
@ -0,0 +1,11 @@
|
||||
use std::process::Command;
|
||||
|
||||
// https://stackoverflow.com/a/44407625
|
||||
fn main() {
|
||||
let output = Command::new("git")
|
||||
.args(&["rev-parse", "HEAD"])
|
||||
.output()
|
||||
.unwrap();
|
||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||
}
|
||||
@ -323,7 +323,7 @@ impl NetworkManager {
|
||||
}
|
||||
|
||||
fn identifier() -> String {
|
||||
format!("{}@{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))
|
||||
format!("{}@{}", env!("CARGO_PKG_NAME"), env!("GIT_HASH"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user