mirror of
https://github.com/containers/podman.git
synced 2025-05-17 23:26:08 +08:00
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:
4
Makefile
4
Makefile
@ -499,9 +499,7 @@ endef
|
||||
fi
|
||||
|
||||
.install.golangci-lint: .gopathok
|
||||
if [ ! -x "$(GOBIN)/golangci-lint" ]; then \
|
||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOBIN)/ v1.18.0; \
|
||||
fi
|
||||
VERSION=1.18.0 GOBIN=$(GOBIN) sh ./hack/install_golangci.sh
|
||||
|
||||
.install.md2man: .gopathok
|
||||
if [ ! -x "$(GOMD2MAN)" ]; then \
|
||||
|
5
hack/install_golangci.sh
Normal file
5
hack/install_golangci.sh
Normal 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
|
Reference in New Issue
Block a user