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