Compare commits
No commits in common. "cf4796909e088d823b836076c8e7053ce578a1d2" and "b7e33dc4b40f3d11e248703120fbf46651608907" have entirely different histories.
cf4796909e
...
b7e33dc4b4
@ -1,4 +1,4 @@
|
|||||||
use std::{fs, path::PathBuf, process::Command};
|
use std::process::Command;
|
||||||
|
|
||||||
// https://stackoverflow.com/a/44407625
|
// https://stackoverflow.com/a/44407625
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -7,17 +7,6 @@ fn main() {
|
|||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||||
match fs::read_to_string("../.git/HEAD") {
|
println!("cargo:rustc-rerun-if-changed=.git/HEAD");
|
||||||
Ok(contents) => {
|
|
||||||
if let Some(branch_path) = contents.split(" ").skip(1).next() {
|
|
||||||
let path = PathBuf::from(".git").join(branch_path);
|
|
||||||
let path = path.to_str().unwrap_or(".git/HEAD");
|
|
||||||
println!("cargo:rerun-if-changed={}", path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(err) => {
|
|
||||||
println!("cargo::warning=Failed to read .git/HEAD: {}", err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user