use the ddev env variable to retrieve the projects docroot - #35
Conversation
|
hm the PR works locally making the |
|
and i still not have finally figured out what the actual error for the two failing tests is. unable to associate which the test responsible for the test run fail actually is. the output is not necessarily helpful or i am simply blind :( |
The installer runs under set -u, so reading DDEV_DOCROOT unguarded aborts with an unbound-variable error when the script is invoked outside a DDEV-provided environment, such as the direct-invocation bats tests. Use the colon-less default expansion so an unset variable falls back to web while DDEV's set-but-empty value (project-root docroot) still passes through unchanged.
|
Thanks Ralf, this is the right fix. I pushed a small commit on top of your branch. The installer runs under Fair warning for anyone testing on a project-root docroot: this gets node dependencies installed in phase 3, but most of the rest of the code still turns an empty docroot back into |
|
Tests pass now, good progress! |
|
Assigned, just for attention. Please don't take it as presumption. |
The Issue
the manual detection in
detect_docroot()had the shortcoming that an empty string within the docroot variable in the ddev config yaml was considered different to.- the docroot is not getting properly set. that way node dependencies are not getting installed in step 3 if the project has the project root as the docroot.How This PR Solves The Issue
ddev provides a set of env variables https://docs.ddev.com/en/stable/users/extend/custom-commands/#environment-variables-provided .
DDEV_DOCROOTwhich is one of those, contains the docroot set for the project at hand. that way it is possible to dropdetect_docroot()and simply setdcq_docroot="${DDEV_DOCROOT}"Manual Testing Instructions
Automated Testing Overview
Release/Deployment Notes