refactor: hide git commit if empty

main
sudo pacman -Syu 2022-06-01 14:41:59 +07:00
parent 221663d4f9
commit a1cdb179d7
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,12 @@ func (a *action) RunVersion(c *cli.Context) error {
return nil
}
fmt.Printf("%s-%s\n", info.MainModuleVersion, info.GitCommit)
if info.GitCommit != "" {
fmt.Printf("%s-%s\n", info.MainModuleVersion, info.GitCommit)
} else {
fmt.Println(info.MainModuleVersion)
}
return nil
}