Skip to content

Commit 65a7d05

Browse files
author
Nate Smith
authored
Merge pull request cli#387 from ahmedelgabri/master
Make sure editor is set properly & not overridden later
2 parents bd97b84 + 4a5135d commit 65a7d05

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/surveyext/editor.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,11 @@ var (
2525
func init() {
2626
if runtime.GOOS == "windows" {
2727
editor = "notepad"
28-
}
29-
if g := os.Getenv("GIT_EDITOR"); g != "" {
28+
} else if g := os.Getenv("GIT_EDITOR"); g != "" {
3029
editor = g
31-
}
32-
if v := os.Getenv("VISUAL"); v != "" {
30+
} else if v := os.Getenv("VISUAL"); v != "" {
3331
editor = v
34-
}
35-
if e := os.Getenv("EDITOR"); e != "" {
32+
} else if e := os.Getenv("EDITOR"); e != "" {
3633
editor = e
3734
}
3835
}

0 commit comments

Comments
 (0)