mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 19:21:25 +00:00
create: Pass editor arguments from newContentEditor correctly
If newContentEditor has editor name with arguments like `emacsclient -n`, it fails with `executable file not found in $PATH`. This change parses the value correctly and passes it to the given editor. Signed-off-by: Bhavin Gandhi <bhavin7392@gmail.com>
This commit is contained in:
parent
3261678f63
commit
d48a98c477
1 changed files with 2 additions and 1 deletions
|
@ -105,7 +105,8 @@ func NewContent(
|
|||
if editor != "" {
|
||||
jww.FEEDBACK.Printf("Editing %s with %q ...\n", targetPath, editor)
|
||||
|
||||
cmd := exec.Command(editor, contentPath)
|
||||
editorCmd := append(strings.Fields(editor), contentPath)
|
||||
cmd := exec.Command(editorCmd[0], editorCmd[1:]...)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
|
Loading…
Reference in a new issue