mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-01 21:11:29 +03:00
update build.rs with optional git command (#236)
This commit is contained in:
11
build.rs
11
build.rs
@@ -8,8 +8,13 @@ fn main() {
|
|||||||
.arg("--dirty")
|
.arg("--dirty")
|
||||||
.arg("--tags")
|
.arg("--tags")
|
||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.map(|output| String::from_utf8(output.stdout).ok())
|
||||||
|
.ok()
|
||||||
let git_describe = String::from_utf8(git_describe.stdout).unwrap();
|
.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}");
|
println!("cargo::rustc-env=GIT_DESCRIBE={git_describe}");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user