mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
Propagate HOME env to go command execution (#960)
This commit is contained in:
committed by
Aaron Schlesinger
parent
c097fc8d79
commit
5ab820de96
@@ -160,6 +160,7 @@ func downloadModule(goBinaryName string, fs afero.Fs, gopath, repoRoot, module,
|
||||
// successfully (such as GOPATH, GOCACHE, PATH etc)
|
||||
func PrepareEnv(gopath string) []string {
|
||||
pathEnv := fmt.Sprintf("PATH=%s", os.Getenv("PATH"))
|
||||
homeEnv := fmt.Sprintf("HOME=%s", os.Getenv("HOME"))
|
||||
httpProxy := fmt.Sprintf("HTTP_PROXY=%s", os.Getenv("HTTP_PROXY"))
|
||||
httpsProxy := fmt.Sprintf("HTTPS_PROXY=%s", os.Getenv("HTTPS_PROXY"))
|
||||
noProxy := fmt.Sprintf("NO_PROXY=%s", os.Getenv("NO_PROXY"))
|
||||
@@ -167,7 +168,7 @@ func PrepareEnv(gopath string) []string {
|
||||
cacheEnv := fmt.Sprintf("GOCACHE=%s", filepath.Join(gopath, "cache"))
|
||||
disableCgo := "CGO_ENABLED=0"
|
||||
enableGoModules := "GO111MODULE=on"
|
||||
cmdEnv := []string{pathEnv, gopathEnv, cacheEnv, disableCgo, enableGoModules, httpProxy, httpsProxy, noProxy}
|
||||
cmdEnv := []string{pathEnv, homeEnv, gopathEnv, cacheEnv, disableCgo, enableGoModules, httpProxy, httpsProxy, noProxy}
|
||||
|
||||
// add Windows specific ENV VARS
|
||||
if runtime.GOOS == "windows" {
|
||||
|
||||
Reference in New Issue
Block a user