error if empty editor
This commit is contained in:
parent
c4ee8e7b04
commit
b18ea5ff7b
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue