Skip to content

Commit e903648

Browse files
committed
fix(shared): Include pre-release info in floating version
This was previously also fixed across two PRs for boil: - stackabletech/docker-images#1601 - stackabletech/docker-images#1606 This is a further indicator that this should live in a central crate which can be used across our codebase. This will be done in a follow-up PR.
1 parent 87100f7 commit e903648

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎crates/stackable-shared/src/semver.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ impl VersionExt for ::semver::Version {
3434
if self.is_floating() {
3535
self.to_string()
3636
} else {
37-
format!("{major}.{minor}", major = self.major, minor = self.minor)
37+
let mut version = format!("{major}.{minor}", major = self.major, minor = self.minor);
38+
if !self.pre.is_empty() {
39+
version.push('-');
40+
version.push_str(&self.pre);
41+
}
42+
43+
version
3844
}
3945
}
4046

0 commit comments

Comments
 (0)