mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Improve LookPath
This commit is contained in:
@@ -18,12 +18,12 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/gohugoio/hugo/common/hexec"
|
||||
"github.com/gohugoio/hugo/hugofs/files"
|
||||
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
@@ -105,7 +105,10 @@ func NewContent(
|
||||
jww.FEEDBACK.Printf("Editing %s with %q ...\n", targetPath, editor)
|
||||
|
||||
editorCmd := append(strings.Fields(editor), contentPath)
|
||||
cmd := exec.Command(editorCmd[0], editorCmd[1:]...)
|
||||
cmd, err := hexec.SafeCommand(editorCmd[0], editorCmd[1:]...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
Reference in New Issue
Block a user