mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
c8b5ab75b7
commit
0aca99fe01
1 changed files with 12 additions and 3 deletions
|
@ -343,15 +343,24 @@ func (b *contentBuilder) openInEditorIfConfigured(filename string) error {
|
|||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue