dartsass: Improve error message when no read access

Fixes #9662
This commit is contained in:
Bjørn Erik Pedersen 2022-03-15 08:54:56 +01:00
parent 61cf3c9f63
commit b60e1bbdfe

View file

@ -16,6 +16,7 @@
package dartsass package dartsass
import ( import (
"fmt"
"io" "io"
"github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/helpers"
@ -77,6 +78,9 @@ func (c *Client) toCSS(args godartsass.Args, src io.Reader) (godartsass.Result,
res, err := c.transpiler.Execute(args) res, err := c.transpiler.Execute(args)
if err != nil { if err != nil {
if err.Error() == "unexpected EOF" {
return res, fmt.Errorf("got unexpected EOF when executing %q. The user running hugo must have read and execute permissions on this program. With execute permissions only, this error is thrown.", dartSassEmbeddedBinaryName)
}
return res, err return res, err
} }