Skip to content

Commit

Permalink
helix-term build: check git hash length
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Feb 16, 2022
1 parent d11b652 commit e87ad6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helix-term/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ fn main() {
.args(&["rev-parse", "HEAD"])
.output()
.ok()
.and_then(|x| String::from_utf8(x.stdout).ok());
.and_then(|x| String::from_utf8(x.stdout).ok())
.filter(|hash| hash.len() >= 8);

let version: Cow<_> = match git_hash {
Some(git_hash) => format!("{} ({})", env!("CARGO_PKG_VERSION"), &git_hash[..8]).into(),
Expand Down

0 comments on commit e87ad6d

Please sign in to comment.