Skip to content
This repository was archived by the owner on Mar 6, 2020. It is now read-only.

Commit 06c44d8

Browse files
committed
Include $PROJECT/bin in $PATH for gb generate
Projects may want to use binaries in $PROJECT/bin in `//go:generate` Closes #630
1 parent 137520c commit 06c44d8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmd/gb/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ See 'go help generate'.
2929
Run: func(ctx *gb.Context, args []string) error {
3030
env := cmd.MergeEnv(os.Environ(), map[string]string{
3131
"GOPATH": fmt.Sprintf("%s%c%s", ctx.Projectdir(), filepath.ListSeparator, filepath.Join(ctx.Projectdir(), "vendor")),
32+
"PATH": fmt.Sprintf("%s%c%s", filepath.Join(ctx.Projectdir(), "bin"), filepath.ListSeparator, os.Environ["PATH"]),
3233
})
3334

3435
cmd := exec.Command("go", append([]string{"generate"}, args...)...)

0 commit comments

Comments
 (0)