summaryrefslogtreecommitdiff
path: root/tagWindow.go
diff options
context:
space:
mode:
Diffstat (limited to 'tagWindow.go')
-rw-r--r--tagWindow.go29
1 files changed, 17 insertions, 12 deletions
diff --git a/tagWindow.go b/tagWindow.go
index 5f7c7f7..4f0efbc 100644
--- a/tagWindow.go
+++ b/tagWindow.go
@@ -1,6 +1,7 @@
package repostatus
import (
+ "errors"
"path/filepath"
"regexp"
"slices"
@@ -44,10 +45,10 @@ type GitTagBox struct {
tags []*Tag
}
-func (rs *RepoStatus) makeTagBox(box *gui.Node) {
+func (rs *RepoStatus) makeTagBox(box *gui.Node) error {
if rs.Tags != nil {
log.Log(WARN, "already scanned tags")
- return
+ return errors.New("already scanned tags")
}
tagB := new(GitTagBox)
rs.Tags = tagB
@@ -98,12 +99,13 @@ func (rs *RepoStatus) makeTagBox(box *gui.Node) {
format := strings.Join(tags, "_,,,_")
cmd := []string{"git", "for-each-ref", "--sort=taggerdate", "--format", format}
// log.Info("RUNNING:", strings.Join(cmd, " "))
- err, output := rs.RunCmd(cmd)
- if err != nil {
- output = "git error_,,,_a_,,,_b_,,,c"
+ r := rs.Run(cmd)
+ if r.Error != nil {
+ log.Warn("git for-each-ref error:", r.Error)
+ return r.Error
}
- lines := strings.Split(output, "\n")
+ lines := r.Stdout
// reverse the git order
slices.Reverse(lines)
tagB.tags = make([]*Tag, 0)
@@ -146,6 +148,7 @@ func (rs *RepoStatus) makeTagBox(box *gui.Node) {
}
// reverse the git order
// slices.Reverse(rtags.tags)
+ return nil
}
func (rtags *GitTagBox) ListAll() []*Tag {
@@ -246,18 +249,20 @@ func (rtags *GitTagBox) PruneSmart() {
func (rs *RepoStatus) DeleteTag(rt *Tag) {
cmd := []string{"git", "push", "--delete", "origin", rt.tag.String()}
log.Info("RUN:", cmd)
- err, output := rs.RunCmd(cmd)
- if err != nil {
- log.Info("cmd failed", err)
+ r := rs.Run(cmd)
+ output := strings.Join(r.Stdout, "\n")
+ if r.Error != nil {
+ log.Info("cmd failed", r.Error)
log.Info("output:", output)
}
log.Info("output:", output)
cmd = []string{"git", "tag", "--delete", rt.tag.String()}
log.Info("RUN:", cmd)
- err, output = rs.RunCmd(cmd)
- if err != nil {
- log.Info("cmd failed", err)
+ r = rs.Run(cmd)
+ output = strings.Join(r.Stdout, "\n")
+ if r.Error != nil {
+ log.Info("cmd failed", r.Error)
log.Info("output:", output)
}
log.Info("output:", output)