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 <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2020-01-15 08:47:03 +01:00
parent b6155c1657
commit b830d3eb07
2 changed files with 6 additions and 3 deletions

5
hack/install_golangci.sh Normal file
View File

@ -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