diff --git a/pkg/editor/editor.go b/pkg/editor/editor.go index 25edd19..ae9ff43 100644 --- a/pkg/editor/editor.go +++ b/pkg/editor/editor.go @@ -1,6 +1,7 @@ package editor import ( + "fmt" "io/fs" "os" "os/exec" @@ -18,6 +19,10 @@ type Editor struct { func (e *Editor) EditFile(filename string) error { args := append(e.Args, filename) + if e.Command == "" { + return fmt.Errorf("no editor set or detected") + } + cmd := exec.Command(e.Command, args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout