mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: update version output when commit SHA is not present
This commit is contained in:
parent
b82587e2c9
commit
0f1d849322
1 changed files with 4 additions and 2 deletions
|
|
@ -58,10 +58,12 @@ impl Default for Args {
|
|||
let args = Self::parse();
|
||||
|
||||
if args.version {
|
||||
let commit_sha =
|
||||
(env!("VERGEN_GIT_SHA") != "VERGEN_IDEMPOTENT_OUTPUT").then_some(env!("VERGEN_GIT_SHA"));
|
||||
println!(
|
||||
"yazi {} ({} {})",
|
||||
"yazi {} ({}{})",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
env!("VERGEN_GIT_SHA"),
|
||||
commit_sha.map(|v| format!("{v} ")).unwrap_or_default(),
|
||||
env!("VERGEN_BUILD_DATE")
|
||||
);
|
||||
process::exit(0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue