Only override version pre-release if blank

pull/498/head
Armon Dadgar 10 years ago
parent 7994484dc7
commit 603171df09

@ -1,11 +1,12 @@
package main package main
import ( import (
"os"
"os/signal"
"github.com/hashicorp/consul/command" "github.com/hashicorp/consul/command"
"github.com/hashicorp/consul/command/agent" "github.com/hashicorp/consul/command/agent"
"github.com/mitchellh/cli" "github.com/mitchellh/cli"
"os"
"os/signal"
) )
// Commands is the mapping of all the available Consul commands. // Commands is the mapping of all the available Consul commands.
@ -94,14 +95,13 @@ func init() {
}, },
"version": func() (cli.Command, error) { "version": func() (cli.Command, error) {
ver := "" ver := Version
rel := "" rel := VersionPrerelease
if len(GitDescribe) == 0 { if GitDescribe != "" {
ver = Version
rel = "dev"
} else {
ver = GitDescribe ver = GitDescribe
rel = VersionPrerelease }
if GitDescribe == "" && rel == "" {
rel = "dev"
} }
return &command.VersionCommand{ return &command.VersionCommand{

Loading…
Cancel
Save