diff --git a/scripts/protoc_installer.sh b/scripts/protoc_installer.sh index 8772b1b07b72..1ec2ca46e625 100644 --- a/scripts/protoc_installer.sh +++ b/scripts/protoc_installer.sh @@ -2,7 +2,8 @@ # Install protoc PROTOC_VERSION="25.2" -# Function to download pre-built binaries for Linux +# Function to download pre-built binaries for Linux with +# ARCH as $1, OS as $2, and WORKDIR as $3 arguments. download_binary() { # Download URL (adjust if a newer release is available) DOWNLOAD_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-$2-$1.zip" @@ -13,7 +14,8 @@ download_binary() { rm "protoc-${PROTOC_VERSION}-$2-$1.zip" } -download_protoc() { +# Function to install protoc with WORKDIR as argument +install_protoc() { # Determine architecture if [[ $(uname -m) == "x86_64" ]]; then ARCH="x86_64" diff --git a/scripts/regenerate.sh b/scripts/regenerate.sh index 60cd91fa9907..5e6368a20165 100755 --- a/scripts/regenerate.sh +++ b/scripts/regenerate.sh @@ -22,7 +22,7 @@ function finish { } trap finish EXIT -export GOBIN="${WORKDIR}"/bin +GOBIN="${WORKDIR}"/bin export PATH="${GOBIN}:${PATH}" mkdir -p "${GOBIN}" @@ -49,7 +49,7 @@ echo "curl https://raw.githubusercontent.com/googleapis/googleapis/master/google curl --silent https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto > "${WORKDIR}/googleapis/google/rpc/code.proto" source ./scripts/protoc_installer.sh -download_protoc $WORKDIR +install_protoc $WORKDIR mkdir -p "${WORKDIR}/out" @@ -83,7 +83,6 @@ SOURCES=( # Note that the protos listed here are all for testing purposes. All protos to # be used externally should have a go_package option (and they don't need to be # listed here). -# listed here). OPTS=Mgrpc/core/stats.proto=google.golang.org/grpc/interop/grpc_testing/core,\ Mgrpc/testing/benchmark_service.proto=google.golang.org/grpc/interop/grpc_testing,\ Mgrpc/testing/stats.proto=google.golang.org/grpc/interop/grpc_testing,\ diff --git a/scripts/vet-proto.sh b/scripts/vet-proto.sh index 76c35a1c0f45..cdfbebf8273e 100755 --- a/scripts/vet-proto.sh +++ b/scripts/vet-proto.sh @@ -30,7 +30,7 @@ if [[ "$1" = "-install" ]]; then popd elif [[ -z "${VET_SKIP_PROTO}" ]]; then source ./scripts/protoc_installer.sh - download_protoc + install_protoc protoc --version else # TODO: replace with install protoc when https://github.com/grpc/grpc-go/pull/7064 is merged.