github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/hack/install_golangci.sh (about)

     1  #!/bin/bash
     2  
     3  set -e
     4  
     5  die() { echo "${1:-No error message given} (from $(basename $0))"; exit 1; }
     6  
     7  [ -n "$VERSION" ] || die "\$VERSION is empty or undefined"
     8  [ -n "$GOBIN" ] || die "\$GOBIN is empty or undefined"
     9  
    10  BIN="$GOBIN/golangci-lint"
    11  if [ ! -x "$BIN" ]; then
    12      echo "Installing golangci-lint v$VERSION into $GOBIN"
    13      curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOBIN v$VERSION
    14  else
    15      # Prints it's own file name as part of --verison output
    16      echo "Using existing $(dirname $BIN)/$($BIN --version)"
    17  fi