6f287f08d958ed9a4b3cb3637245c009072d318a

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

Return errMsg when menu is zero

Fixes: https://github.com/charmbracelet/soft-serve-internal/issues/5

Diff

 1diff --git a/tui/commands.go b/tui/commands.go
 2index 64ee06d78f4cbc17c4262005e07ded2210f8fdf1..e88856e99e926d8e3fa73045a60a9bb275e04b27 100644
 3--- a/tui/commands.go
 4+++ b/tui/commands.go
 5@@ -35,6 +35,9 @@ func (b *Bubble) setupCmd() tea.Msg {
 6 			mes = append(mes, MenuEntry{Name: r.Name, Repo: r.Name})
 7 		}
 8 	}
 9+	if len(mes) == 0 {
10+		return errMsg{fmt.Errorf("no repos found")}
11+	}
12 	var tmplConfig *Config
13 	for _, me := range mes {
14 		if me.Repo == "config" {