mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-22 12:55:13 +00:00
Show commit hash in version number
This commit is contained in:
parent
0191eead52
commit
1e333dfb33
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Version output displays `git` revision information.
|
||||
|
||||
## [0.3.0] - 2020-03-30
|
||||
|
||||
### Added
|
||||
|
14
build.rs
Normal file
14
build.rs
Normal file
@ -0,0 +1,14 @@
|
||||
fn main() {
|
||||
let git_describe = std::process::Command::new("git")
|
||||
.args(&["describe", "--tags", "--broken"])
|
||||
.output()
|
||||
.ok()
|
||||
.and_then(|proc| String::from_utf8(proc.stdout).ok());
|
||||
|
||||
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);
|
||||
}
|
@ -8,7 +8,7 @@ use anyhow::Result;
|
||||
use structopt::StructOpt;
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[structopt(about = "A cd command that learns your habits")]
|
||||
#[structopt(about = "A cd command that learns your habits", version = env!("ZOXIDE_VERSION"))]
|
||||
enum Zoxide {
|
||||
Add(subcommand::Add),
|
||||
Import(subcommand::Import),
|
||||
|
Loading…
Reference in New Issue
Block a user