diff options
author | Bhavin Gandhi <[email protected]> | 2020-10-15 20:53:48 +0530 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-10-24 20:34:03 +0200 |
commit | d48a98c477a818d28008d9771050d2681e63e880 (patch) | |
tree | 4ab0c6862cbf18d4e7e1609ccf438a979fce6740 /create | |
parent | 3261678f63fd66810db77ccaf9a0c0e426be5380 (diff) | |
download | hugo-d48a98c477a818d28008d9771050d2681e63e880.tar.gz hugo-d48a98c477a818d28008d9771050d2681e63e880.zip |
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 <[email protected]>
Diffstat (limited to 'create')
-rw-r--r-- | create/content.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/create/content.go b/create/content.go index 0e05adf93..13e668201 100644 --- a/create/content.go +++ b/create/content.go @@ -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 |