-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
FIX: Support working directories containing whitespace #646
Conversation
sorry for the messy merges... I was having issues with some of the tests that seemed unrelated to my changes, and the build process on github kept failing so I tried to catchup since I saw there was a linter problem fixed. I had the same issues with the tests trying to run them on the main branch of my fork as well, even when my fork was caught up. I ended up just testing my PR manually on a local project and it works on my machine 🤷♂️ . Is there a known issue with some of the tests in their current state? I couldn't find any open issues about it. |
this is causing issue #659, I am not sure why does space in path an cause issues, test paths with spaces using windows 11 it works fine, so I am not sure how to test this but could you use something like this? |
@omarattia3143 Sorry for the bug, I don't have windows for testing, PR is welcome~ |
@osteensco can you confirm that this PR still works with this code? I have only windows and I can not test your changes
|
@@ -327,6 +329,9 @@ func (c *Config) preprocess() error { | |||
// CMD will not recognize relative path like ./tmp/server | |||
c.Build.Bin, err = filepath.Abs(c.Build.Bin) | |||
|
|||
// Account for spaces in filepath | |||
c.Build.Bin = fmt.Sprintf("%q", c.Build.Bin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is causing an error on Windows, the exe can't be found and the path includes escape characters like this:
'\"c:\\go\\hello\\tmp\\hello.exe\"' is not recognized as an internal or external command,
operable program or batch file.
When if it was actually missing the error would be: this when the exe is missing and I run it from a command prompt
'c:\go\hello\tmp\hello.exe' is not recognized as an internal or external command,
operable program or batch file.
This seems not working either |
@moboqe this is not merged, It works if you dont have space in your path, I made it so it can bypass the issue created by this PR. |
I mean this doesn't work for me related for this issue. |
addresses #546 #472, probably more
I believe this solution is OS agnostic but happy to adjust if it doesn't work somewhere.