use os.UserHomeDir()

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-01 21:45:04 -05:00
parent efba612ad6
commit 8d55a8316a
1 changed files with 8 additions and 19 deletions

View File

@ -160,29 +160,18 @@ func downloadRepo(path string) bool {
log.Info("downloading", path, "here") log.Info("downloading", path, "here")
os.Setenv("GO111MODULE", "off") os.Setenv("GO111MODULE", "off")
// goSrcDir := me.goSrcPwd.String() homeDir, _ := os.UserHomeDir()
goSrcDir := "/home/jcarr/go/src" goSrcDir := filepath.Join(homeDir, "go/src")
err, ok, output := shell.RunCmd(goSrcDir, []string{"go", "get", "-v", path})
if !ok {
log.Info("go get failed")
log.Info("err =", err)
log.Info("output =", output)
return false
}
fullpath := filepath.Join(goSrcDir, path) cmd := []string{"go-clone", "--recursive", "--no-work", "--go-src", path}
err, ok, output = shell.RunCmd(fullpath, []string{"go", "get", "-v", "-u", "."}) err := shell.NewRun(goSrcDir, cmd)
if !ok { if err != nil {
log.Info("go get depends failed") log.Info("go-clone failed")
log.Info("err =", err) log.Info("err =", err)
log.Info("output =", output) // log.Info("output =", output)
return false return false
} }
/* log.Info("go-clone worked")
if me.autoDryRun.Checked() {
return false
}
*/
return true return true
} }