mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
Improve LookPath
This commit is contained in:
parent
ae2d1bd52d
commit
10ae7c3210
18 changed files with 129 additions and 42 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue