10up / wp-local-docker-v2

ARCHIVED: A simple Docker based development environment for WordPress.
MIT License
484 stars 81 forks source link

Fix issue where 10updocker fails to add custom domain entries in `/etc/hosts`. #338

Closed desaiuditd closed 1 year ago

desaiuditd commented 1 year ago

Description of the Change

Seems like the code assumes that the file path for mkcertPrebuilt is a valid file system path. It's not always the case.

Sometimes (as is the case in #312) the Node is installed in a directory where there's a space in the directory name. Such paths with a space in-between will break the script, if not escaped properly.

As it's rightly pointed out https://github.com/10up/wp-local-docker-v2/issues/312#issuecomment-1325528607.

I've escaped the shell binary path with double quotes so that unexpected space characters in the file path doesn't break the script.

Closes #312

How to test the Change

Not sure. Haven't followed any testing strategy here. But happy to follow any guidance here.

Changelog Entry

Fixed - Bug fix #312

Credits

Props ...

Checklist: