From df48225954cca9b6a4d4dfe1cb8e9491b47a40a4 Mon Sep 17 00:00:00 2001 From: Noah Date: Sun, 7 Apr 2024 13:54:46 -0500 Subject: [PATCH] refactor(times): Handle 'since' option before starting bubble tea indicator --- times.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/times.go b/times.go index d829768..dfbf3a7 100644 --- a/times.go +++ b/times.go @@ -15,6 +15,12 @@ import ( ) func times() { + since, err := tparse.AddDuration(time.Now(), "-"+*arguments.Times.since) + if err != nil { + fmt.Printf("Failed to parse time string '%s'\n", *arguments.Times.since) + os.Exit(1) + } + finished := false p := tea.NewProgram(initialIndicator("Fetching time logs...")) go func() { @@ -27,12 +33,6 @@ func times() { } }() - since, err := tparse.AddDuration(time.Now(), "-"+*arguments.Times.since) - if err != nil { - fmt.Printf("Failed to parse time string '%s'\n", *arguments.Times.since) - os.Exit(1) - } - times := getTimeLogs(since, func(repo gitea.Repository, took time.Duration) { p.Send(IndicatorInfo{ info: fmt.Sprintf("%s / %s", repo.Owner.UserName, repo.Name),