From a463089df1d6ada45149b5554b27349c47214fa0 Mon Sep 17 00:00:00 2001 From: Sridhar Ganesan Date: Mon, 16 Jul 2018 23:58:40 +0200 Subject: [PATCH] Using cosmos-sdk version from the library itself --- cmd/cosmos-sdk-cli/cmd/init.go | 5 +++++ cmd/cosmos-sdk-cli/template/Gopkg.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/cosmos-sdk-cli/cmd/init.go b/cmd/cosmos-sdk-cli/cmd/init.go index 17b048c2b3..713f7e81a7 100644 --- a/cmd/cosmos-sdk-cli/cmd/init.go +++ b/cmd/cosmos-sdk-cli/cmd/init.go @@ -9,6 +9,7 @@ import ( "strings" "time" + "github.com/cosmos/cosmos-sdk/version" "github.com/gobuffalo/packr" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -59,6 +60,10 @@ var initCmd = &cobra.Command{ fmt.Println("Creating file: " + actualPath) contents := box.String(path) contents = replacer.Replace(contents) + if actualPath == "Gopkg.toml" { + versionReplacer := strings.NewReplacer("_COSMOS_VERSION_", version.Version) + contents = versionReplacer.Replace(contents) + } lastIndex := strings.LastIndex(actualPath, string(os.PathSeparator)) rootDir := "" if lastIndex != -1 { diff --git a/cmd/cosmos-sdk-cli/template/Gopkg.toml b/cmd/cosmos-sdk-cli/template/Gopkg.toml index 551f1ca7fd..6b9f230497 100644 --- a/cmd/cosmos-sdk-cli/template/Gopkg.toml +++ b/cmd/cosmos-sdk-cli/template/Gopkg.toml @@ -46,7 +46,7 @@ name = "github.com/tendermint/go-wire" [[constraint]] - version = "~0.22.0" + version = "~_COSMOS_VERSION_" name = "github.com/cosmos/cosmos-sdk" [[override]]