mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-08 04:20:01 +03:00
21 lines
574 B
Rust
21 lines
574 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
// commit hash
|
|
let git_describe = Command::new("git")
|
|
.arg("describe")
|
|
.arg("--always")
|
|
.arg("--dirty")
|
|
.arg("--tags")
|
|
.output()
|
|
.map(|output| String::from_utf8(output.stdout).ok())
|
|
.ok()
|
|
.flatten()
|
|
.unwrap_or_else(|| {
|
|
println!("cargo:warning=Failed to get git describe");
|
|
String::from("unknown")
|
|
});
|
|
let git_describe = git_describe.trim().to_string();
|
|
println!("cargo::rustc-env=GIT_DESCRIBE={git_describe}");
|
|
}
|