Skip to content
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

Handle spaces in project path for devc #1797

Closed
cherylking opened this issue Feb 22, 2024 · 3 comments
Closed

Handle spaces in project path for devc #1797

cherylking opened this issue Feb 22, 2024 · 3 comments

Comments

@cherylking
Copy link
Member

When running devc on Windows for a project with spaces in the path, the following error happens. The spaces in the -f parameter for docker build are causing an issue. Need to quote the path correctly when adding it to the command. Check other parts of the command to see if spaces affect them as well.

Error starting the server in dev mode.: Could not build container image using Containerfile: C:\Users\xyz\my path with spaces\Dockerfile. Address the following container build error and then start dev mode again: ERROR: "docker build" requires exactly 1 argument. RC=1
@cherylking
Copy link
Member Author

The solution seems to be to add each part of the command as a separate String (pass a String[] to the ProcessBuilder constructor). Then ProcessBuilder is supposed to handle escaping/quoting the parameters if necessary. Need to test this and see if it performs as expected.

The changes would be needed in DevUtil.java in ci.common - in particular in methods getRunProcess, getContainerCommand, buildContainerImage, and startContainer.

@cherylking
Copy link
Member Author

Just noting here I was able to reproduce on a Mac as well. So It's not just a Windows problem.

@cherylking
Copy link
Member Author

Fix was tested on both Mac and Windows with success. Closing this issue. Fix will be in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant