use go-cmd/cmd

This commit is contained in:
Jeff Carr 2024-11-08 06:44:08 -06:00
parent 8d55a8316a
commit c4d4a25800
2 changed files with 5 additions and 6 deletions

View File

@ -23,7 +23,8 @@ func DumpVersions(view *repolist.RepoList) {
continue continue
} }
lastTag := r.LastTag() lastTag := r.LastTag()
_, out := r.Status.RunCmd([]string{"git", "log", "-1", "--format=%at", lastTag}) result := r.Status.Run([]string{"git", "log", "-1", "--format=%at", lastTag})
out := strings.Join(result.Stdout, "\n")
out = strings.TrimSpace(out) out = strings.TrimSpace(out)
// Convert the string to an integer // Convert the string to an integer

View File

@ -164,11 +164,9 @@ func downloadRepo(path string) bool {
goSrcDir := filepath.Join(homeDir, "go/src") goSrcDir := filepath.Join(homeDir, "go/src")
cmd := []string{"go-clone", "--recursive", "--no-work", "--go-src", path} cmd := []string{"go-clone", "--recursive", "--no-work", "--go-src", path}
err := shell.NewRun(goSrcDir, cmd) r := shell.PathRun(goSrcDir, cmd)
if err != nil { if r.Error != nil {
log.Info("go-clone failed") log.Info("go-clone failed error", r.Error)
log.Info("err =", err)
// log.Info("output =", output)
return false return false
} }
log.Info("go-clone worked") log.Info("go-clone worked")