🎨 user cache dir
This commit is contained in:
parent
07e9f4654f
commit
be2d5b74b3
|
@ -106,12 +106,18 @@ func parsePath(curDir, outputLine string) string {
|
||||||
|
|
||||||
func setCmdEnv(cmd *exec.Cmd, username string) {
|
func setCmdEnv(cmd *exec.Cmd, username string) {
|
||||||
userWorkspace := conf.GetUserWorkspace(username)
|
userWorkspace := conf.GetUserWorkspace(username)
|
||||||
|
cache, err := os.UserCacheDir()
|
||||||
|
if nil != err {
|
||||||
|
logger.Warnf("Get user cache dir failed [" + err.Error() + "]")
|
||||||
|
cache = os.TempDir()
|
||||||
|
}
|
||||||
|
|
||||||
cmd.Env = append(cmd.Env,
|
cmd.Env = append(cmd.Env,
|
||||||
"GOPATH="+userWorkspace,
|
"GOPATH="+userWorkspace,
|
||||||
"GOOS="+runtime.GOOS,
|
"GOOS="+runtime.GOOS,
|
||||||
"GOARCH="+runtime.GOARCH,
|
"GOARCH="+runtime.GOARCH,
|
||||||
"GOROOT="+runtime.GOROOT(),
|
"GOROOT="+runtime.GOROOT(),
|
||||||
|
"GOCACHE="+cache,
|
||||||
"PATH="+os.Getenv("PATH"))
|
"PATH="+os.Getenv("PATH"))
|
||||||
|
|
||||||
if util.OS.IsWindows() {
|
if util.OS.IsWindows() {
|
||||||
|
|
Loading…
Reference in New Issue