Do not require git to handle versioning

This commit is contained in:
Jeremy Soller 2024-02-28 12:45:31 -07:00
parent fa86c7f1c4
commit 707eb18334
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
3 changed files with 13 additions and 5 deletions

View file

@ -4,9 +4,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Emit version information (if not cached by just vendor)
let mut vergen = vergen::EmitBuilder::builder();
println!("cargo:rerun-if-env-changed=VERGEN_GIT_COMMIT_DATE");
if std::env::var_os("VERGEN_GIT_COMMIT_DATE").is_none() {
vergen.git_commit_date();
}
println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA");
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
vergen.git_sha(true);
}