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

Commit

Permalink
Include $PROJECT/bin in $PATH for gb generate
Browse files Browse the repository at this point in the history
Projects may want to use binaries in $PROJECT/bin in `//go:generate`

Closes #630
  • Loading branch information
pritambaral committed Jan 16, 2017
1 parent 137520c commit 06c44d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/gb/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ See 'go help generate'.
Run: func(ctx *gb.Context, args []string) error {
env := cmd.MergeEnv(os.Environ(), map[string]string{
"GOPATH": fmt.Sprintf("%s%c%s", ctx.Projectdir(), filepath.ListSeparator, filepath.Join(ctx.Projectdir(), "vendor")),
"PATH": fmt.Sprintf("%s%c%s", filepath.Join(ctx.Projectdir(), "bin"), filepath.ListSeparator, os.Environ["PATH"]),
})

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

0 comments on commit 06c44d8

Please sign in to comment.