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>
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