Skip to content

Commit

Permalink
feat: add GOBIN to avoid overwrite exist bins
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Jun 17, 2024
1 parent c5c4bce commit 0e89fac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ go.work.sum

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

.task
.task
mockgen
golangci-lint
10 changes: 6 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: '3'
env:
GOBIN: { sh: pwd }

tasks:
default:
Expand Down Expand Up @@ -81,17 +83,17 @@ tasks:
sh: |
cat go.mod|grep go.uber.org/mock |awk -F ' ' '{print $2}'
status:
- (ls $GOPATH/bin/mockgen >> /dev/null 2>&1 && echo yes) || echo ""
- go version -m $GOPATH/bin/mockgen | grep go.uber.org/mock | grep {{.VERSION}}
- test -f mockgen
- go version -m $GOBIN/mockgen | grep go.uber.org/mock | grep {{.VERSION}}
cmd: |
go install go.uber.org/mock/mockgen@{{.VERSION}}
install:golangci-lint:
vars:
VERSION: v1.56.2
status:
- (ls $GOPATH/bin/golangci-lint >> /dev/null 2>&1 && echo yes) || echo ""
- go version -m $GOPATH/bin/golangci-lint | grep github.com/golangci/golangci-lint | grep {{.VERSION}}
- test -f golangci-lint
- go version -m $GOBIN/golangci-lint | grep github.com/golangci/golangci-lint | grep {{.VERSION}}
cmd: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@{{.VERSION}}
Expand Down

0 comments on commit 0e89fac

Please sign in to comment.