Don't show "Version v" on startup if empty (#653)

We'll still show the SHA in this case
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-10-13 10:47:14 -04:00
1 parent dfa94c7990
commit 868a65ac3d
1 file changed
+4 -2
+4 -2
View File
@@ -208,9 +208,11 @@ func (b *Server) SetupMetrics(ui cli.Ui, telemetry *configutil.Telemetry) error
}
func (b *Server) PrintInfo(ui cli.Ui) {
b.InfoKeys = append(b.InfoKeys, "version")
verInfo := version.Get()
b.Info["version"] = verInfo.FullVersionNumber(false)
if verInfo.Version != "" {
b.InfoKeys = append(b.InfoKeys, "version")
b.Info["version"] = verInfo.FullVersionNumber(false)
}
if verInfo.Revision != "" {
b.Info["version sha"] = strings.Trim(verInfo.Revision, "'")
b.InfoKeys = append(b.InfoKeys, "version sha")