mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
@@ -27,13 +27,12 @@ import (
|
||||
|
||||
"github.com/gohugoio/hugo/common/collections"
|
||||
"github.com/gohugoio/hugo/common/hexec"
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
"github.com/gohugoio/hugo/common/text"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
|
||||
"github.com/gohugoio/hugo/common/hugo"
|
||||
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
|
||||
"github.com/gohugoio/hugo/resources/internal"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cast"
|
||||
@@ -151,10 +150,12 @@ func (t *postcssTransformation) Key() internal.ResourceTransformationKey {
|
||||
func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationCtx) error {
|
||||
const binaryName = "postcss"
|
||||
|
||||
infol := t.rs.Logger.InfoCommand(binaryName)
|
||||
infoW := loggers.LevelLoggerToWriter(infol)
|
||||
|
||||
ex := t.rs.ExecHelper
|
||||
|
||||
var configFile string
|
||||
logger := t.rs.Logger
|
||||
|
||||
var options Options
|
||||
if t.optionsm != nil {
|
||||
@@ -185,7 +186,7 @@ func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationC
|
||||
var cmdArgs []any
|
||||
|
||||
if configFile != "" {
|
||||
logger.Infoln("postcss: use config file", configFile)
|
||||
infol.Logf("use config file %q", configFile)
|
||||
cmdArgs = []any{"--config", configFile}
|
||||
}
|
||||
|
||||
@@ -194,7 +195,6 @@ func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationC
|
||||
}
|
||||
|
||||
var errBuf bytes.Buffer
|
||||
infoW := loggers.LoggerToWriterWithPrefix(logger.Info(), "postcss")
|
||||
|
||||
stderr := io.MultiWriter(infoW, &errBuf)
|
||||
cmdArgs = append(cmdArgs, hexec.WithStderr(stderr))
|
||||
@@ -401,7 +401,6 @@ func (imp *importResolver) shouldImport(s string) bool {
|
||||
}
|
||||
|
||||
func (imp *importResolver) toFileError(output string) error {
|
||||
output = strings.TrimSpace(loggers.RemoveANSIColours(output))
|
||||
inErr := errors.New(output)
|
||||
|
||||
match := cssSyntaxErrorRe.FindStringSubmatch(output)
|
||||
|
Reference in New Issue
Block a user