mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-05-08 14:38:17 +00:00
71744ade7c
* Expose GitHub hash in UI * Prettier:fix * cargo fmt * Update tests * Fix test
13 lines
356 B
Rust
13 lines
356 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
// Fetch the git hash if possible, <unknown> if not.
|
|
let git_hash = Command::new("git")
|
|
.args(&["rev-parse", "HEAD"])
|
|
.output()
|
|
.map(|output| String::from_utf8(output.stdout).unwrap_or_default())
|
|
.unwrap_or_default();
|
|
|
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
|
}
|