diff options
| author | Jeff Carr <[email protected]> | 2024-11-01 21:45:04 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-01 21:45:04 -0500 | 
| commit | 8d55a8316a0bb22353cda4bed88ed466a8df326b (patch) | |
| tree | 9a93857f9b1b2b95b79459f1548347efe3e2c925 | |
| parent | efba612ad6ea1e9611ed82e7c2f2a497c16d7a82 (diff) | |
use os.UserHomeDir()v0.22.2
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | listWindow.go | 27 | 
1 files changed, 8 insertions, 19 deletions
diff --git a/listWindow.go b/listWindow.go index 6290c99..2f09c60 100644 --- a/listWindow.go +++ b/listWindow.go @@ -160,29 +160,18 @@ func downloadRepo(path string) bool {  	log.Info("downloading", path, "here")  	os.Setenv("GO111MODULE", "off") -	// goSrcDir := me.goSrcPwd.String() -	goSrcDir := "/home/jcarr/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 -	} +	homeDir, _ := os.UserHomeDir() +	goSrcDir := filepath.Join(homeDir, "go/src") -	fullpath := filepath.Join(goSrcDir, path) -	err, ok, output = shell.RunCmd(fullpath, []string{"go", "get", "-v", "-u", "."}) -	if !ok { -		log.Info("go get depends failed") +	cmd :=  []string{"go-clone", "--recursive", "--no-work", "--go-src", path} +	err := shell.NewRun(goSrcDir, cmd) +	if err != nil { +		log.Info("go-clone failed")  		log.Info("err =", err) -		log.Info("output =", output) +		// log.Info("output =", output)  		return false  	} -	/* -		if me.autoDryRun.Checked() { -			return false -		} -	*/ +	log.Info("go-clone worked")  	return true  }  | 
