Skip to content

Commit

Permalink
feat(evil): integrate the latest tag name in the app version info
Browse files Browse the repository at this point in the history
  • Loading branch information
usagi-flow committed Jun 1, 2024
1 parent d2a3d78 commit db71fed
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion helix-loader/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,23 @@ fn main() {
.filter(|output| output.status.success())
.and_then(|x| String::from_utf8(x.stdout).ok());

let git_tag = Command::new("git")
.args(["describe", "--abbrev=0"])
.output()
.ok()
.filter(|output| output.status.success())
.and_then(|x| String::from_utf8(x.stdout).ok());

let calver = get_calver();
let version: Cow<_> = match &git_hash {
Some(git_hash) => format!("{} ({})", calver, &git_hash[..8]).into(),
Some(git_hash) if git_tag.is_some() => format!(
"{} ({}, helix {})",
git_tag.unwrap().trim(),
&git_hash[..8],
calver
)
.into(),
Some(git_hash) => format!("({}, helix {})", &git_hash[..8], calver).into(),
None => calver.into(),
};

Expand Down

0 comments on commit db71fed

Please sign in to comment.