hugo: PostCSS on Windows does not work in directories with spaces
I’m still having this issue as of 5/28/2020. I’ve narrowed down the issue to here: https://github.com/gohugoio/hugo/blob/6add6d77b48cf0aab8b39d7a2bddedb1aa2a52b8/resources/resource_transformers/postcss/postcss.go#L192
Specifically, Go’s exec.Command
will treat spaces in parameters as different parameters, so they must be escaped or quoted if they have spaces.
I do not have the capabilities (right now) to get Hugo building on my machine, but I believe the simplest fix will be somehow escaping the string when passing it to exec.Command
.
I believe, but cannot be certain, that this line should fix this issue:
configFile = `"` + configFile + `"`
This was closed as stale in #6283, but I think my solution should fix the problem.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 16 (6 by maintainers)
This came up again yesterday: https://discourse.gohugo.io/t/failed-to-transform-path-not-found/37309
On Windows, reproduce with:
There’s a workaround where you don’t have to change the project path:
So here’s a repro.
With https://github.com/jannepeltola/hugo_issue_7333/, here’s what happens: