From 410828ca1f2907718420b0d1f715af156baef8d3 Mon Sep 17 00:00:00 2001 From: Kemal Akkoyun Date: Tue, 3 Nov 2020 23:48:07 +0100 Subject: [PATCH] Fix local function issue for variables.env (#47) * Fix local issue for variables.env Signed-off-by: Kemal Akkoyun * Address review issues Signed-off-by: Kemal Akkoyun --- .bingo/variables.env | 18 +++++++++--------- pkg/bingo/env.go | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.bingo/variables.env b/.bingo/variables.env index 8ccb473..39e6280 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -1,22 +1,22 @@ # Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.2. DO NOT EDIT. # All tools are designed to be build inside $GOBIN. # Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. -local gobin=$(go env GOBIN) +GOBIN=${GOBIN:=$(go env GOBIN)} -if [ -z "$gobin" ]; then - gobin="$(go env GOPATH)/bin" +if [ -z "$GOBIN" ]; then + GOBIN="$(go env GOPATH)/bin" fi -COPYRIGHT="${gobin}/copyright-v0.9.0" +COPYRIGHT="${GOBIN}/copyright-v0.9.0" -EMBEDMD="${gobin}/embedmd-v1.0.0" +EMBEDMD="${GOBIN}/embedmd-v1.0.0" -FAILLINT="${gobin}/faillint-v1.5.0" +FAILLINT="${GOBIN}/faillint-v1.5.0" -GOIMPORTS="${gobin}/goimports-v0.0.0-20200519204825-e64124511800" +GOIMPORTS="${GOBIN}/goimports-v0.0.0-20200519204825-e64124511800" -GOLANGCI_LINT="${gobin}/golangci-lint-v1.26.0" +GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.26.0" -MISSPELL="${gobin}/misspell-v0.3.4" +MISSPELL="${GOBIN}/misspell-v0.3.4" diff --git a/pkg/bingo/env.go b/pkg/bingo/env.go index 9fd9363..85027c4 100644 --- a/pkg/bingo/env.go +++ b/pkg/bingo/env.go @@ -9,14 +9,14 @@ const ( envBinVarsTmpl = `# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo {{ .Version }}. DO NOT EDIT. # All tools are designed to be build inside $GOBIN. # Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. -local gobin=$(go env GOBIN) +GOBIN=${GOBIN:=$(go env GOBIN)} -if [ -z "$gobin" ]; then - gobin="$(go env GOPATH)/bin" +if [ -z "$GOBIN" ]; then + GOBIN="$(go env GOPATH)/bin" fi {{range $p := .MainPackages }} -{{ $p.EnvVarName }}="{{- range $i, $v := $p.Versions }}{{- if ne $i 0}} {{- end }}${gobin}/{{ $p.Name }}-{{ $v.Version }}{{- end }}" +{{ $p.EnvVarName }}="{{- range $i, $v := $p.Versions }}{{- if ne $i 0}} {{- end }}${GOBIN}/{{ $p.Name }}-{{ $v.Version }}{{- end }}" {{ end}} ` )