mirror of
https://github.com/dani-garcia/bitwarden_rs
synced 2024-11-26 11:59:49 +01:00
Check some .git
paths to force a rebuild
When a checked-out repo switches to a specific tag, and that tag does not have anything else changed in the files except the tag, it could happen that the build process doesn't see any changes, while it could be that the version string needs to be different. This commit ensures that if some specific paths are changed within the .git directory, cargo will be triggered to rebuild. Fixes #4087
This commit is contained in:
parent
327a8d7b8f
commit
fd9a0597d8
5
build.rs
5
build.rs
@ -48,6 +48,11 @@ fn run(args: &[&str]) -> Result<String, std::io::Error> {
|
||||
/// - env!("GIT_REV")
|
||||
/// - env!("VW_VERSION")
|
||||
fn version_from_git_info() -> Result<String, std::io::Error> {
|
||||
// Rerun when these paths are changed.
|
||||
// Someone could have checked-out a tag or specific commit, but no other files changed.
|
||||
println!("cargo:rerun-if-changed=.git/HEAD");
|
||||
println!("cargo:rerun-if-changed=.git/refs/tags/");
|
||||
|
||||
// The exact tag for the current commit, can be empty when
|
||||
// the current commit doesn't have an associated tag
|
||||
let exact_tag = run(&["git", "describe", "--abbrev=0", "--tags", "--exact-match"]).ok();
|
||||
|
Loading…
Reference in New Issue
Block a user