Skip to content

Commit

Permalink
proto .sh: pull protoc-gen-go version from go.mod
Browse files Browse the repository at this point in the history
addresses review comment ava-labs/icm-services#344 (comment)
  • Loading branch information
feuGeneA committed Jul 22, 2024
1 parent 3e792cf commit 6cfca6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions proto/pb/decider/v1/decider.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion scripts/protobuf_codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ if ! [[ "$0" =~ scripts/protobuf_codegen.sh ]]; then
exit 255
fi

RELAYER_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)

source $RELAYER_PATH/scripts/versions.sh

## ensure the correct version of "buf" is installed
BUF_VERSION='1.31.0'
if [[ $(buf --version | cut -f2 -d' ') != "${BUF_VERSION}" ]]; then
Expand All @@ -15,7 +22,7 @@ if [[ $(buf --version | cut -f2 -d' ') != "${BUF_VERSION}" ]]; then
fi

## install "protoc-gen-go"
PROTOC_GEN_GO_VERSION='v1.33.0'
PROTOC_GEN_GO_VERSION=$(getDepVersion google.golang.org/protobuf)
go install -v google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION}
if [[ $(protoc-gen-go --version | cut -f2 -d' ') != "${PROTOC_GEN_GO_VERSION}" ]]; then
# e.g., protoc-gen-go v1.28.1
Expand Down

0 comments on commit 6cfca6c

Please sign in to comment.