feat: use DRUPAL_PROJECTS_PATH for all commands. fixes #111 #112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Issue
Leverage environment variable DRUPAL_PROJECTS_PATH in all custom ddev commands shipped with ddev-drupal-contrib.
How This PR Solves The Issue
Adds the following line to all commands:
so that the $DRUPAL_PROJECTS_PATH environment variable can be used, if defined in
.ddev/config.local.yaml
, instead of the hardcoded fallback valuemodules/custom
.Manual Testing Instructions
Set a custom symlink location in .ddev/config.local.yaml
Restart, re-symlink, then run one of the additional commands, eg
eslint
(if your module has custom js).Automated Testing Overview
The existing integration from #101 does not have any test coverage for DRUPAL_PROJECTS_PATH. And existing tests still hardcode the modules/custom folder. Happy to add a test if required, but since this is an environment variable, it's unclear how we would actually test this. Can environment variables be passed into
ddev
commands that run inside the web container on the fly?Release/Deployment Notes
No known impacts on other code or existing projects leveraging the ddev-drupal-contrib addon. Existing projects that already leverage DRUPAL_PROJECTS_PATH should find that all of the bundled ddev command now work properly.