Skip to content

Commit 723c6a0

Browse files
committed
fix: barry quick fix, 2025-04-27 23:36:34
1 parent e98374a commit 723c6a0

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

cmds/tagcmd/cmd.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,24 @@ func New() *cli.Command {
2222
Action: func(ctx context.Context, command *cli.Command) error {
2323
defer recovery.Exit()
2424

25-
utils.GitFetchAll()
26-
25+
var done = make(chan struct{})
26+
go func() {
27+
defer close(done)
28+
utils.GitFetchAll()
29+
}()
30+
2731
var p = tea.NewProgram(initialModel())
2832
m := assert.Must1(p.Run()).(model)
29-
var tags = utils.GetGitTags()
30-
ver := utils.GetNextTag(m.selected, tags)
31-
if m.selected == envRelease {
33+
selected := strings.TrimSpace(m.selected)
34+
if selected == "" {
35+
return nil
36+
}
37+
38+
<-done
39+
40+
tags := utils.GetAllGitTags()
41+
ver := utils.GetNextTag(selected, tags)
42+
if selected == envRelease {
3243
ver = utils.GetNextReleaseTag(tags)
3344
}
3445

utils/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/samber/lo"
1919
)
2020

21-
func GetGitTags() []*semver.Version {
21+
func GetAllGitTags() []*semver.Version {
2222
var tagText = strings.TrimSpace(assert.Exit1(RunOutput("git", "tag")))
2323
var tags = strings.Split(tagText, "\n")
2424
var versions = make([]*semver.Version, 0, len(tags))

0 commit comments

Comments
 (0)