fixup! fixup! squash! fixup! Show commit hash in version when built from source
This commit is contained in:
parent
f9f144e1ef
commit
b27d5e1ed5
|
|
@ -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
|
||||
|
||||
|
|
|
|||
11
build.rs
11
build.rs
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue