-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostCSS on Windows does not work in directories with spaces #7333
Comments
Perhaps it would be better to use the Quote() function in strconv, e.g.
Though I'm not sure:
I could test some changes if someone has an example repository that uses PostCSS. |
I don't have a minimal failing example, but anything using the PostCSS hook that is built into Hugo should trigger this error. {{ $css := resources.Get "css/main.css" }}
{{ $style := $css | resources.PostCSS }} on your CSS file with PostCSS installed in a folder where |
Was postcss-cli installed globally ( |
I can confirm this is still an issue. I have tried with both |
Please share your |
Apologies for not doing that right away - here you go:
It is the current version available on Chocolatey. |
If it's helpful, I can spend some time tomorrow to create a minimal repro? Unfortunately I probably won't have time to do it today. |
A minimal demo repo is always helpful. |
So here's a repro. With https://github.com/jannepeltola/hugo_issue_7333/, here's what happens:
|
The underlying issue is that we're executing Related upstream issues: golang/go#15566 golang/go#17149 |
I see. Thanks for looking into this! I'll run Hugo inside Docker for the time being then until when (if...) the upstream issue gets resolved. |
It's a frustrating workaround, but it looks like adding quotes to the exec command should solve this issue. I can set up an environment to test that change. |
I can build and test a branch locally if you need a Windows environment! |
I'm still having this issue as of 5/28/2020. I've narrowed down the issue to here:
hugo/resources/resource_transformers/postcss/postcss.go
Line 192 in 6add6d7
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:
This was closed as stale in #6283, but I think my solution should fix the problem.
The text was updated successfully, but these errors were encountered: