aboutsummaryrefslogtreecommitdiffhomepage
path: root/create
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-12-18 18:20:12 +0100
committerBjørn Erik Pedersen <[email protected]>2020-12-19 17:03:07 +0100
commit10ae7c3210cd1add14d3750aa9512a87df0e1146 (patch)
tree6fa7eb1e9bfe093f3b611bbb286aefe591e1dc7a /create
parentae2d1bd52df0099190ef9195666d0788708b0385 (diff)
downloadhugo-10ae7c3210cd1add14d3750aa9512a87df0e1146.tar.gz
hugo-10ae7c3210cd1add14d3750aa9512a87df0e1146.zip
Improve LookPath
Diffstat (limited to 'create')
-rw-r--r--create/content.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/create/content.go b/create/content.go
index d1594a199..26eda2031 100644
--- a/create/content.go
+++ b/create/content.go
@@ -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