summaryrefslogtreecommitdiff
path: root/hack/install_golangci.sh
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-01-16 10:52:12 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-01-16 15:26:25 +0100
commitd4ca3197b62f6411827eb164edc4e8111aa9733f (patch)
treea46dd0524b9aa470d350474ca0b8a6a5478e0c37 /hack/install_golangci.sh
parent61fbce710b8d69e1203ea9055479a3f9dbe626b9 (diff)
downloadpodman-d4ca3197b62f6411827eb164edc4e8111aa9733f.tar.gz
podman-d4ca3197b62f6411827eb164edc4e8111aa9733f.tar.bz2
podman-d4ca3197b62f6411827eb164edc4e8111aa9733f.zip
hack/install_golangci.sh: check env vars
Also make it executable and `set -eo pipefail`. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'hack/install_golangci.sh')
-rwxr-xr-x[-rw-r--r--]hack/install_golangci.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/hack/install_golangci.sh b/hack/install_golangci.sh
index 9d23bbd31..430685a71 100644..100755
--- 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