Skip to content

Commit

Permalink
Use existing goimports installation if available
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat committed Oct 10, 2022
1 parent 6ec1f4b commit e9f2ca4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/urfave-cli-genflags/Makefile
@@ -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

Expand Down
5 changes: 3 additions & 2 deletions cmd/urfave-cli-genflags/main.go
Expand Up @@ -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,
Expand Down

0 comments on commit e9f2ca4

Please sign in to comment.