Improve LookPath

This commit is contained in:
Bjørn Erik Pedersen
2020-12-18 18:20:12 +01:00
parent ae2d1bd52d
commit 10ae7c3210
18 changed files with 129 additions and 42 deletions

View File

@@ -18,9 +18,10 @@ package asciidocext
import (
"bytes"
"os/exec"
"path/filepath"
"github.com/cli/safeexec"
"github.com/gohugoio/hugo/identity"
"github.com/gohugoio/hugo/markup/asciidocext/asciidocext_config"
"github.com/gohugoio/hugo/markup/converter"
@@ -193,7 +194,7 @@ func (a *asciidocConverter) appendArg(args []string, option, value, defaultValue
}
func getAsciidoctorExecPath() string {
path, err := exec.LookPath("asciidoctor")
path, err := safeexec.LookPath("asciidoctor")
if err != nil {
return ""
}