mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-29 05:16:29 -04:00
20 lines
417 B
Go
20 lines
417 B
Go
//go:build !windows
|
|
|
|
package backend
|
|
|
|
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 {
|
|
// ensure textEditor is set
|
|
textEditor := os.Getenv("EDITOR")
|
|
if textEditor == "" {
|
|
textEditor = FallbackEditor
|
|
}
|
|
return textEditor
|
|
}
|