From b830d3eb07e163864048fb6b4d0873cb61965dd0 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 15 Jan 2020 08:47:03 +0100 Subject: make .install.golangci-lint: force specific version Instead of only performing a presence check of the binary, also do a version check and force installing the specified one if needed. This will prevent users and the CI from using a wrong version in the future. Move the logic into a dedicated shell script as I find built-in bash in Makefiles hard to maintain. Signed-off-by: Valentin Rothberg --- hack/install_golangci.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 hack/install_golangci.sh (limited to 'hack/install_golangci.sh') diff --git a/hack/install_golangci.sh b/hack/install_golangci.sh new file mode 100644 index 000000000..9d23bbd31 --- /dev/null +++ b/hack/install_golangci.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e +$GOBIN/golangci-lint --version | grep $VERSION +if [ $? -ne 0 ]; then + 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