From 368d58e61ab3f9978c7cf51ee4c0d45263b9e5c5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 31 Oct 2024 22:07:56 +0200 Subject: refactor --- internal/queue/queue.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'internal/queue/queue.go') diff --git a/internal/queue/queue.go b/internal/queue/queue.go index 59882cc..74ba00f 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -1,7 +1,6 @@ package queue import ( - "errors" "fmt" "log" "os" @@ -53,17 +52,7 @@ func queueEntries(args config.Args) error { if err != nil { return err } - // TODO Refactor this prompting mechanism plus possible choices for DRY - err = prompt.DoYouWantThis("Do you want to queue this content", content) - switch { - case errors.Is(err, prompt.ErrEditContent): - err = ent.Edit() - case errors.Is(err, prompt.ErrDeleteFile): - if err = ent.Remove(); err == nil { - continue - } - } - if err != nil { + if err := prompt.FileAction("Do you want to queue this content", content, ent.Path); err != nil { return err } } -- cgit v1.2.3