From f1b5adc392da9df78b198b2ab2ee420602a11169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Zywert?= Date: Fri, 29 Mar 2024 23:04:24 +0100 Subject: [PATCH] ok, I can distinct those cases easily - but maybe it's not clear --- gojira/cli.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gojira/cli.go b/gojira/cli.go index bfb879c..1dec2a1 100644 --- a/gojira/cli.go +++ b/gojira/cli.go @@ -133,7 +133,11 @@ var IssuesCommand = &cli.Command{ return err } err = spinner.New().Title("Logging work...").Action(func() { - err = issue.LogWork(app.time, timeSpent) + if initialTimeSpent != "" { + err = worklog.Update(timeSpent) + } else { + err = issue.LogWork(app.time, timeSpent) + } }).Run() if err != nil { return err @@ -275,6 +279,7 @@ func (issue Issue) LogWork(logTime *time.Time, timeSpent string) error { return err } if Config.UpdateExistingWorklog { + // FIXME should I append worklog or replace it? for index, workLog := range todayWorklog { if workLog.Issue.Key == issue.Key { timeSpentSum := FormatTimeSpent(TimeSpentToSeconds(timeSpent) + workLog.TimeSpentSeconds)