From 6f287f08d958ed9a4b3cb3637245c009072d318a Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 22 Sep 2021 17:27:13 -0400 Subject: [PATCH] Return errMsg when menu is zero Fixes: https://github.com/charmbracelet/soft-serve-internal/issues/5 --- tui/commands.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tui/commands.go b/tui/commands.go index 64ee06d78f4cbc17c4262005e07ded2210f8fdf1..e88856e99e926d8e3fa73045a60a9bb275e04b27 100644 --- a/tui/commands.go +++ b/tui/commands.go @@ -35,6 +35,9 @@ func (b *Bubble) setupCmd() tea.Msg { mes = append(mes, MenuEntry{Name: r.Name, Repo: r.Name}) } } + if len(mes) == 0 { + return errMsg{fmt.Errorf("no repos found")} + } var tmplConfig *Config for _, me := range mes { if me.Repo == "config" {