fixup! fixup! squash! fixup! Show commit hash in version when built from source

This commit is contained in:
Cole Helbling 2020-03-31 14:24:50 -07:00
parent f9f144e1ef
commit b27d5e1ed5
No known key found for this signature in database
GPG Key ID: B37E0F2371016A4C
2 changed files with 5 additions and 8 deletions

View File

@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Commit hash to version output.
- Version output displays `git` revision information.
## [0.3.0] - 2020-03-30

View File

@ -5,13 +5,10 @@ fn main() {
.ok()
.and_then(|proc| String::from_utf8(proc.stdout).ok());
let mut version_info = format!("v{}-unknown", env!("CARGO_PKG_VERSION"));
if let Some(description) = git_describe {
if !description.is_empty() {
version_info = description;
}
}
let version_info = match git_describe {
Some(description) if !description.is_empty() => description,
_ => format!("v{}-unknown", env!("CARGO_PKG_VERSION")),
};
println!("cargo:rustc-env=ZOXIDE_VERSION={}", version_info);
}