Skip to content

Commit e9f2ca4

Browse files
committed
Use existing goimports installation if available
1 parent 6ec1f4b commit e9f2ca4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/urfave-cli-genflags/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
GOIMPORTS_BIN ?= $(shell which goimports || true)
12
GOTEST_FLAGS ?= -v --coverprofile main.coverprofile --covermode count --cover github.com/urfave/cli/v2/cmd/urfave-cli-genflags
23
GOBUILD_FLAGS ?= -x
34

5+
export GOIMPORTS_BIN
6+
47
.PHONY: all
58
all: test build smoke-test
69

cmd/urfave-cli-genflags/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ func main() {
9494
Value: "cli.",
9595
},
9696
&cli.PathFlag{
97-
Name: "goimports",
98-
Value: filepath.Join(top, ".local/bin/goimports"),
97+
Name: "goimports",
98+
EnvVars: []string{"GOIMPORTS_BIN"},
99+
Value: filepath.Join(top, ".local/bin/goimports"),
99100
},
100101
},
101102
Action: runGenFlags,

0 commit comments

Comments
 (0)