Use existing goimports installation if available

This commit is contained in:
Dan Buch 2022-10-10 08:48:50 -04:00
parent 6ec1f4bb44
commit e9f2ca42db
Signed by: meatballhat
GPG Key ID: A12F782281063434
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,9 @@
GOIMPORTS_BIN ?= $(shell which goimports || true)
GOTEST_FLAGS ?= -v --coverprofile main.coverprofile --covermode count --cover github.com/urfave/cli/v2/cmd/urfave-cli-genflags
GOBUILD_FLAGS ?= -x
export GOIMPORTS_BIN
.PHONY: all
all: test build smoke-test

View File

@ -94,8 +94,9 @@ func main() {
Value: "cli.",
},
&cli.PathFlag{
Name: "goimports",
Value: filepath.Join(top, ".local/bin/goimports"),
Name: "goimports",
EnvVars: []string{"GOIMPORTS_BIN"},
Value: filepath.Join(top, ".local/bin/goimports"),
},
},
Action: runGenFlags,