From 2e55875cc72fdfa7bdcd13a1290c842eb5566b48 Mon Sep 17 00:00:00 2001 From: CFC4N Date: Fri, 30 Oct 2020 20:58:00 +0800 Subject: [PATCH] scripts: install github.com/myitcv/gobin while gobin doesn't exist. --- scripts/genproto.sh | 2 -- scripts/test_lib.sh | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/genproto.sh b/scripts/genproto.sh index 405c60dd9..c7656ac91 100755 --- a/scripts/genproto.sh +++ b/scripts/genproto.sh @@ -17,8 +17,6 @@ if [[ $(protoc --version | cut -f2 -d' ') != "3.12.3" ]]; then exit 255 fi -run env GO111MODULE=off go get -u github.com/myitcv/gobin - GOFAST_BIN=$(tool_get_bin github.com/gogo/protobuf/protoc-gen-gofast) GRPC_GATEWAY_BIN=$(tool_get_bin github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway) SWAGGER_BIN=$(tool_get_bin github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger) diff --git a/scripts/test_lib.sh b/scripts/test_lib.sh index 9b0e8648b..9769de9c5 100644 --- a/scripts/test_lib.sh +++ b/scripts/test_lib.sh @@ -278,6 +278,11 @@ function tool_exists { fi } +# Ensure gobin is available, as it runs majority of the tools +if ! command -v "gobin" >/dev/null; then + run env GO111MODULE=off go get github.com/myitcv/gobin || exit 1 +fi + # tool_get_bin [tool] - returns absolute path to a tool binary (or returns error) function tool_get_bin { tool_exists "gobin" "GO111MODULE=off go get github.com/myitcv/gobin" || return 2 @@ -308,5 +313,3 @@ function run_go_tool { run "${cmdbin}" "$@" || return 2 } -# Ensure gobin is available, as it runs majority of the tools -run env GO111MODULE=off go get github.com/myitcv/gobin