Improve stderr logging for PostCSS and simlilar

Fixes #7584
This commit is contained in:
Bjørn Erik Pedersen
2020-08-20 18:43:09 +02:00
parent ae63c2b5c9
commit ec37420468
7 changed files with 77 additions and 25 deletions

View File

@@ -15,11 +15,12 @@ package babel
import (
"io"
"os"
"os/exec"
"path/filepath"
"strconv"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/resources/internal"
@@ -157,7 +158,7 @@ func (t *babelTransformation) Transform(ctx *resources.ResourceTransformationCtx
cmd := exec.Command(binary, cmdArgs...)
cmd.Stdout = ctx.To
cmd.Stderr = os.Stderr
cmd.Stderr = loggers.LoggerToWriterWithPrefix(logger.INFO, "babel")
cmd.Env = hugo.GetExecEnviron(t.rs.Cfg)
stdin, err := cmd.StdinPipe()