Skip to content

Commit

Permalink
fix err output when golangci-lint is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Sep 15, 2023
1 parent 7b50a46 commit b2b507e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ BIN="$REPO_DIR"/bin

mkdir -p "$BIN"

# install golangci-lint if it doesn't exist or is the wrong version
if [ ! -f "$BIN"/golangci-lint ]; then
if ! "$BIN"/golangci-lint --version | grep -q "$GOLANGCI_LINT_VERSION"; then
GOBIN="$BIN" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION"
fi
# install golangci-lint bin/golangci-lint doesn't exist with the correct version
if ! "$BIN"/golangci-lint --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then
GOBIN="$BIN" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION"
fi

MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)"
Expand Down

0 comments on commit b2b507e

Please sign in to comment.