aboutsummaryrefslogtreecommitdiffhomepage
path: root/create/content.go
diff options
context:
space:
mode:
Diffstat (limited to 'create/content.go')
-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