diff options
| author | Paul Buetow <paul@buetow.org> | 2024-10-19 18:45:40 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-10-19 18:45:40 +0300 |
| commit | c072a8a06c9634948497f4ef5e69b832c80be195 (patch) | |
| tree | e97d54e6da2fc3f8c6d627653bb4a19a5e887f70 /internal/prompt | |
| parent | 3287dbc49f3a9df43b086da84516b7e0a9902707 (diff) | |
jo
Diffstat (limited to 'internal/prompt')
| -rw-r--r-- | internal/prompt/prompt.go | 7 |
1 files changed, 3 insertions, 4 deletions
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") } |
