Skip to content

Commit

Permalink
readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jarojasm95 committed Aug 14, 2021
1 parent 2b36e22 commit 218cede
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/editor/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
const defaultEditor = "vi"

func getEditor() string {
editorFromEnv := os.Getenv("KUBE_EDITOR")
if editorFromEnv == "" {
editorFromEnv = os.Getenv("EDITOR")
if editorFromEnv == "" {
editorFromEnv = defaultEditor
}
if os.Getenv("KUBE_EDITOR") != "" {
return os.Getenv("KUBE_EDITOR")
}
return editorFromEnv

if os.Getenv("EDITOR") != "" {
return os.Getenv("EDITOR")
}

return defaultEditor
}

//Edit opens the editor
Expand Down

0 comments on commit 218cede

Please sign in to comment.