Unify version in all binaries

This commit is contained in:
Ethan Frey 2017-08-17 23:47:58 +01:00
parent a908c24235
commit 663f96b491
5 changed files with 7 additions and 32 deletions

View File

@ -1,29 +0,0 @@
package commands
import (
"fmt"
"github.com/spf13/cobra"
"github.com/tendermint/basecoin/version"
)
// VersionCmd - command to show the application version
var VersionCmd = &cobra.Command{
Use: "version",
Short: "Show version info",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(version.Version)
},
}
// QuickVersionCmd - returns a version command based on version input
func QuickVersionCmd(version string) *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Show version info",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(version)
},
}
}

View File

@ -6,6 +6,7 @@ import (
"github.com/tendermint/tmlibs/cli"
"github.com/tendermint/basecoin"
client "github.com/tendermint/basecoin/client/commands"
"github.com/tendermint/basecoin/cmd/basecoin/commands"
"github.com/tendermint/basecoin/modules/auth"
"github.com/tendermint/basecoin/modules/base"
@ -51,7 +52,7 @@ func main() {
commands.StartCmd,
//commands.RelayCmd,
commands.UnsafeResetAllCmd,
commands.VersionCmd,
client.VersionCmd,
)
cmd := cli.PrepareMainCmd(rt, "BC", os.ExpandEnv("$HOME/.basecoin"))

View File

@ -6,6 +6,7 @@ import (
"github.com/tendermint/tmlibs/cli"
"github.com/tendermint/basecoin"
client "github.com/tendermint/basecoin/client/commands"
"github.com/tendermint/basecoin/cmd/basecoin/commands"
"github.com/tendermint/basecoin/modules/base"
"github.com/tendermint/basecoin/modules/eyes"
@ -36,7 +37,7 @@ func main() {
InitCmd,
commands.StartCmd,
commands.UnsafeResetAllCmd,
commands.VersionCmd,
client.VersionCmd,
)
cmd := cli.PrepareMainCmd(rt, "EYE", os.ExpandEnv("$HOME/.eyes"))

View File

@ -7,6 +7,7 @@ import (
"github.com/tendermint/tmlibs/cli"
client "github.com/tendermint/basecoin/client/commands"
"github.com/tendermint/basecoin/cmd/basecoin/commands"
"github.com/tendermint/basecoin/docs/guide/counter/plugins/counter"
)
@ -24,7 +25,7 @@ func main() {
commands.InitCmd,
commands.StartCmd,
commands.UnsafeResetAllCmd,
commands.VersionCmd,
client.VersionCmd,
)
cmd := cli.PrepareMainCmd(RootCmd, "CT", os.ExpandEnv("$HOME/.counter"))

View File

@ -70,6 +70,7 @@ func main() {
BaseCli.AddCommand(
commands.InitCmd,
commands.ResetCmd,
commands.VersionCmd,
keycmd.RootCmd,
seeds.RootCmd,
query.RootCmd,