From d4ca3197b62f6411827eb164edc4e8111aa9733f Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 16 Jan 2020 10:52:12 +0100 Subject: hack/install_golangci.sh: check env vars Also make it executable and `set -eo pipefail`. Signed-off-by: Valentin Rothberg --- hack/install_golangci.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) mode change 100644 => 100755 hack/install_golangci.sh (limited to 'hack') diff --git a/hack/install_golangci.sh b/hack/install_golangci.sh old mode 100644 new mode 100755 index 9d23bbd31..430685a71 --- a/hack/install_golangci.sh +++ b/hack/install_golangci.sh @@ -1,5 +1,17 @@ -#!/bin/bash -e +#!/bin/bash + +if [ -z "$VERSION" ]; then + echo \$VERSION is empty + exit 1 +fi + +if [ -z "$GOBIN" ]; then + echo \$GOBIN is empty + exit 1 +fi + $GOBIN/golangci-lint --version | grep $VERSION if [ $? -ne 0 ]; then + set -e curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOBIN v$VERSION fi -- cgit v1.2.3-54-g00ecf