Improve LookPath

This commit is contained in:
Bjørn Erik Pedersen 2020-12-18 18:20:12 +01:00
parent ae2d1bd52d
commit 10ae7c3210
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
18 changed files with 129 additions and 42 deletions

View file

@ -28,6 +28,8 @@ import (
"strings"
"time"
"github.com/gohugoio/hugo/common/hexec"
hglob "github.com/gohugoio/hugo/hugofs/glob"
"github.com/gobwas/glob"
@ -537,7 +539,10 @@ func (c *Client) runGo(
}
stderr := new(bytes.Buffer)
cmd := exec.CommandContext(ctx, "go", args...)
cmd, err := hexec.SafeCommandContext(ctx, "go", args...)
if err != nil {
return err
}
cmd.Env = c.environ
cmd.Dir = c.ccfg.WorkingDir