Skip to content
Myr

docs: default to vim if no EDITOR on exec example (#325)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Carlos Alexandro Becker · committed by GitHub · parent 04d68b8 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:examples/exec/main.go+5 added-1 removed
9 unmodified lines
1011type editorFinishedMsg struct{ err error }1213func openEditor() tea.Cmd {14 editor := os.Getenv("EDITOR")15 if editor == "" {16 editor = "vim"17 }14 c := exec.Command(os.Getenv("EDITOR")) //nolint:gosec18 c := exec.Command(editor) //nolint:gosec19 return tea.ExecProcess(c, func(err error) tea.Msg {20 return editorFinishedMsg{err}21 })22}
49 unmodified lines