Skip to content

Commit

Permalink
build: Fix versioning number generation
Browse files Browse the repository at this point in the history
We accidentally always generated '-dirty' even when the directory was
clean.
  • Loading branch information
kalkin committed Oct 8, 2022
1 parent 6889e2c commit 19898c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ fn main() {
{
let commits_since_release = commits_since_release();
let changed_since_release = commits_since_release != "0";
let changed_files = status.success();

let cargo_version = env!("CARGO_PKG_VERSION");
let version = match (changed_since_release, status.success()) {
(false, false) => cargo_version.to_owned(),
(false, true) => format!("{}+dirty", cargo_version),
let version = match (changed_since_release, changed_files) {
(false, true) => cargo_version.to_owned(),
(false, false) => format!("{}+dirty", cargo_version),
(true, clean) => {
let id_out = Command::new("git")
.args(&["rev-parse", "--short", "HEAD"])
Expand Down

0 comments on commit 19898c7

Please sign in to comment.