Skip to content

Commit

Permalink
Trim CosmWasm /v2 suffix from package string pulled from go mod (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
pharr117 authored Jul 23, 2024
1 parent 73fa52a commit 67a28bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func getWasmvmVersion(modFile *modfile.File) string {
for _, item := range modFile.Require {
// Must have 2 tokens, repo & version
if (len(item.Syntax.Token) == 2) && (strings.Contains(item.Syntax.Token[0], wasmvmRepo)) {
wasmvmRepo = item.Syntax.Token[0]
wasmvmRepo = strings.TrimSuffix(item.Syntax.Token[0], "/v2")
wasmvmVersion = item.Syntax.Token[1]
}
}
Expand All @@ -251,7 +251,7 @@ func getWasmvmVersion(modFile *modfile.File) string {
for _, item := range modFile.Replace {
// Must have 3 or more tokens
if (len(item.Syntax.Token) > 2) && (strings.Contains(item.Syntax.Token[0], wasmvmRepo)) {
wasmvmRepo = item.Syntax.Token[len(item.Syntax.Token)-2]
wasmvmRepo = strings.TrimSuffix(item.Syntax.Token[len(item.Syntax.Token)-2], "/v2")
wasmvmVersion = item.Syntax.Token[len(item.Syntax.Token)-1]
}
}
Expand Down

0 comments on commit 67a28bb

Please sign in to comment.