Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Dec 8, 2023
1 parent 1172215 commit 2fd20a2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ignite/pkg/cosmosbuf/buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (b Buf) Update(ctx context.Context, modDir string, dependencies ...string)
// Export runs the buf Export command for the files in the proto directory.
func (b Buf) Export(ctx context.Context, protoDir, output string) error {
// Check if the proto directory is the Cosmos SDK one
if strings.HasSuffix(protoDir, cosmosver.CosmosSDK) {
if strings.Contains(protoDir, cosmosver.CosmosModulePath) {
if b.sdkProtoDir == "" {
// Copy Cosmos SDK proto path without the Buf workspace.
// This is done because the workspace contains a reference to
Expand Down Expand Up @@ -164,7 +164,7 @@ func (b Buf) Generate(
// can't download this folder because is unused as a dependency. We need to
// change the workspace copying the files to another folder and generate the
// files.
if strings.HasSuffix(protoDir, cosmosver.CosmosSDK) {
if strings.Contains(protoDir, cosmosver.CosmosModulePath) {
if b.sdkProtoDir == "" {
b.sdkProtoDir, err = copySDKProtoDir(protoDir)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions ignite/pkg/cosmosver/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
var (
// CosmosModulePath defines Cosmos SDK import path.
CosmosModulePath = "github.com/cosmos/cosmos-sdk"
// CosmosSDK defines Cosmos SDK repository name.
CosmosSDK = "cosmos-sdk"
// CosmosSDKModulePathPattern defines a regexp pattern for Cosmos SDK import path.
CosmosSDKModulePathPattern = regexp.MustCompile(`github\.com\/[^\/]+\/cosmos-sdk`)
)
Expand Down
2 changes: 1 addition & 1 deletion ignite/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func Long(ctx context.Context) string {
// AssertSupportedCosmosSDKVersion asserts that a Cosmos SDK version is supported by Ignite CLI.
func AssertSupportedCosmosSDKVersion(v cosmosver.Version) error {
if v.LT(cosmosver.StargateFortySevenTwoVersion) {
return fmt.Errorf(errOldCosmosSDKVersionStr, v) //nolint:staticcheck // this gives a prettier error message
return fmt.Errorf(errOldCosmosSDKVersionStr, v) //nolint:stylecheck // gives a prettier error message
}
return nil
}
7 changes: 6 additions & 1 deletion ignite/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ func TestAssertSupportedCosmosSDKVersion(t *testing.T) {
{
"invalid",
cosmosver.Version{Version: "invalid"},
"your chain has been scaffolded with an older version of Cosmos SDK: invalid",
"Your chain has been scaffolded with an older version of Cosmos SDK: invalid",
},
{
"too old",
cosmosver.Version{Version: "v0.45.0", Semantic: semver.MustParse("0.45.0")},
"Your chain has been scaffolded with an older version of Cosmos SDK: v0.45.0",
},
{
"v0.47.3",
Expand Down

0 comments on commit 2fd20a2

Please sign in to comment.