mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
b.h.Log.Printf("Editing %q with %q ...\n", filename, editor)
|
editorExec := strings.Fields(editor)[0]
|
||||||
cmd, err := b.h.Deps.ExecHelper.New(
|
editorFlags := strings.Fields(editor)[1:]
|
||||||
editor,
|
|
||||||
|
var args []interface{}
|
||||||
|
for _, editorFlag := range editorFlags {
|
||||||
|
args = append(args, editorFlag)
|
||||||
|
}
|
||||||
|
args = append(
|
||||||
|
args,
|
||||||
filename,
|
filename,
|
||||||
hexec.WithStdin(os.Stdin),
|
hexec.WithStdin(os.Stdin),
|
||||||
hexec.WithStderr(os.Stderr),
|
hexec.WithStderr(os.Stderr),
|
||||||
hexec.WithStdout(os.Stdout),
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue