mirror of https://github.com/spikecodes/libreddit
Non-git fallback
This commit is contained in:
parent
1cc3104498
commit
05c3cca365
4
build.rs
4
build.rs
|
@ -1,6 +1,6 @@
|
|||
use std::process::Command;
|
||||
fn main() {
|
||||
let output = Command::new("git").args(["rev-parse", "HEAD"]).output().unwrap();
|
||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||
let output = String::from_utf8(Command::new("git").args(["rev-parse", "HEAD"]).output().unwrap().stdout).unwrap_or_default();
|
||||
let git_hash = if output == String::default() { "dev".into() } else { output };
|
||||
println!("cargo:rustc-env=GIT_HASH={git_hash}");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue