return nil
}
- b.h.Log.Printf("Editing %q with %q ...\n", filename, editor)
- cmd, err := b.h.Deps.ExecHelper.New(
- editor,
+ editorExec := strings.Fields(editor)[0]
+ editorFlags := strings.Fields(editor)[1:]
+
+ var args []interface{}
+ for _, editorFlag := range editorFlags {
+ args = append(args, editorFlag)
+ }
+ args = append(
+ args,
filename,
hexec.WithStdin(os.Stdin),
hexec.WithStderr(os.Stderr),
hexec.WithStdout(os.Stdout),
)
+ b.h.Log.Printf("Editing %q with %q ...\n", filename, editorExec)
+
+ cmd, err := b.h.Deps.ExecHelper.New(editorExec, args...)
if err != nil {
return err
}