github.com/pokt-network/tendermint@v0.32.11-0.20230426215212-59310158d3e9/scripts/install-golangci-lint.sh (about)

     1  #!/bin/bash
     2  
     3  set -euo pipefail
     4  
     5  f_sha256() {
     6    local l_file
     7    l_file=$1
     8    python -sBc "import hashlib;print(hashlib.sha256(open('$l_file','rb').read()).hexdigest())"
     9  }
    10  
    11  installer="$(mktemp)"
    12  trap "rm -f ${installer}" EXIT
    13  
    14  GOBIN="${1}"
    15  VERSION="${2}"
    16  HASHSUM="${3}"
    17  CURL="$(which curl)"
    18  
    19  echo "Downloading golangci-lint ${VERSION} installer ..." >&2
    20  "${CURL}" -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh" > "${installer}"
    21  
    22  echo "Checking hashsum ..." >&2
    23  [ "${HASHSUM}" = "$(f_sha256 ${installer})" ]
    24  chmod +x "${installer}"
    25  
    26  echo "Launching installer ..." >&2
    27  exec "${installer}" -d -b "${GOBIN}" "${VERSION}"