Skip to content

Commit

Permalink
fix(version): Check version length before truncating
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 6, 2023
1 parent 4ad80fb commit 5103a01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ func initConfig() error {
func buildVersion() string {
result := util.GetVersion()
if commit := util.GetCommit(); commit != "" {
result += " (" + commit[:8] + ")"
if len(commit) > 8 {
commit = commit[:8]
}
result += " (" + commit + ")"
}
return result
}

0 comments on commit 5103a01

Please sign in to comment.