Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-18 20:20:12 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-19 19:03:07 +0300
commit10ae7c3210cd1add14d3750aa9512a87df0e1146 (patch)
tree6fa7eb1e9bfe093f3b611bbb286aefe591e1dc7a /scripts/fork_go_templates
parentae2d1bd52df0099190ef9195666d0788708b0385 (diff)
Improve LookPath
Diffstat (limited to 'scripts/fork_go_templates')
-rw-r--r--scripts/fork_go_templates/main.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/fork_go_templates/main.go b/scripts/fork_go_templates/main.go
index c295ab734..b66c8a111 100644
--- a/scripts/fork_go_templates/main.go
+++ b/scripts/fork_go_templates/main.go
@@ -5,11 +5,12 @@ import (
"io/ioutil"
"log"
"os"
- "os/exec"
"path/filepath"
"regexp"
"strings"
+ "github.com/gohugoio/hugo/common/hexec"
+
"github.com/gohugoio/hugo/common/hugio"
"github.com/spf13/afero"
@@ -203,7 +204,7 @@ func removeAll(expression, content string) string {
}
func rewrite(filename, rule string) {
- cmf := exec.Command("gofmt", "-w", "-r", rule, filename)
+ cmf, _ := hexec.SafeCommand("gofmt", "-w", "-r", rule, filename)
out, err := cmf.CombinedOutput()
if err != nil {
log.Fatal("gofmt failed:", string(out))
@@ -211,7 +212,7 @@ func rewrite(filename, rule string) {
}
func goimports(dir string) {
- cmf := exec.Command("goimports", "-w", dir)
+ cmf, _ := hexec.SafeCommand("goimports", "-w", dir)
out, err := cmf.CombinedOutput()
if err != nil {
log.Fatal("goimports failed:", string(out))
@@ -219,7 +220,7 @@ func goimports(dir string) {
}
func gofmt(dir string) {
- cmf := exec.Command("gofmt", "-w", dir)
+ cmf, _ := hexec.SafeCommand("gofmt", "-w", dir)
out, err := cmf.CombinedOutput()
if err != nil {
log.Fatal("gofmt failed:", string(out))