mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Shorten commit SHA in version output
This commit is contained in:
parent
2bae07eac9
commit
ee81103ce0
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -137,9 +137,9 @@ func main() {
|
|||
}
|
||||
|
||||
func init() {
|
||||
if CommitSHA != "" {
|
||||
if len(CommitSHA) >= 7 {
|
||||
vt := rootCmd.VersionTemplate()
|
||||
rootCmd.SetVersionTemplate(vt[:len(vt)-1] + " (" + CommitSHA + ")\n")
|
||||
rootCmd.SetVersionTemplate(vt[:len(vt)-1] + " (" + CommitSHA[0:7] + ")\n")
|
||||
}
|
||||
if Version == "" {
|
||||
Version = "unknown (built from source)"
|
||||
|
|
Loading…
Reference in a new issue