mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-28 04:46:41 -04:00
19 lines
384 B
Go
19 lines
384 B
Go
//go:build !windows
|
|
|
|
package cli
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
const fallbackEditor = "vi" // vi is pre-installed on most UNIX systems
|
|
|
|
// textEditorFallback returns the value of the $EDITOR environment variable, or FallbackEditor if it is not set
|
|
func textEditorFallback() string {
|
|
textEditor := os.Getenv("EDITOR")
|
|
if textEditor == "" {
|
|
textEditor = fallbackEditor
|
|
}
|
|
return textEditor
|
|
}
|