Skip to content

Commit

Permalink
dartsass: Improve error message when no read access
Browse files Browse the repository at this point in the history
Fixes #9662
  • Loading branch information
bep committed Mar 15, 2022
1 parent 61cf3c9 commit b60e1bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/resource_transformers/tocss/dartsass/client.go
Expand Up @@ -16,6 +16,7 @@
package dartsass

import (
"fmt"
"io"

"github.com/gohugoio/hugo/helpers"
Expand Down Expand Up @@ -77,6 +78,9 @@ func (c *Client) toCSS(args godartsass.Args, src io.Reader) (godartsass.Result,

res, err := c.transpiler.Execute(args)
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
}

Expand Down

0 comments on commit b60e1bb

Please sign in to comment.