From c072a8a06c9634948497f4ef5e69b832c80be195 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 19 Oct 2024 18:45:40 +0300 Subject: jo --- internal/prompt/prompt.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal/prompt') diff --git a/internal/prompt/prompt.go b/internal/prompt/prompt.go index bf5997d..6eecf60 100644 --- a/internal/prompt/prompt.go +++ b/internal/prompt/prompt.go @@ -46,8 +46,7 @@ func whatNow(question string) error { continue } - input = strings.TrimSpace(input) - switch strings.ToLower(input) { + switch strings.ToLower(strings.TrimSpace(input)) { case "y", "yes": return nil case "n", "no": @@ -61,8 +60,8 @@ func whatNow(question string) error { } func EditFile(filePath string) error { - editor := os.Getenv("EDITOR") - if editor == "" { + editor, ok := os.LookupEnv("EDITOR") + if !ok { return errors.New("EDITOR environment variable is not set") } -- cgit v1.2.3