You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
646 B

3 years ago
  1. #!/usr/bin/env bash
  2. set -eu -o pipefail
  3. SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
  4. BINARY_PATH="$SCRIPT_PATH/golangci-lint"
  5. DOWNLOAD_URL=''
  6. if uname -a | grep 'Darwin' &> /dev/null; then
  7. DOWNLOAD_URL='https://github.com/golangci/golangci-lint/releases/download/v1.40.1/golangci-lint-1.40.1-darwin-amd64.tar.gz'
  8. else
  9. DOWNLOAD_URL='https://github.com/golangci/golangci-lint/releases/download/v1.40.1/golangci-lint-1.40.1-linux-amd64.tar.gz'
  10. fi
  11. cd "$SCRIPT_PATH"
  12. curl -fsSL "$DOWNLOAD_URL" | tar -xz
  13. BINARY="$(find golangci-lint-*/golangci-lint)"
  14. mv "$BINARY" "$BINARY_PATH"
  15. rm -rf "$(find golangci-lint-*/ -type d)"