Skip to content

feat: use DRUPAL_PROJECTS_PATH for all commands. fixes #111 #112

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jameswilson
Copy link

@jameswilson jameswilson commented Apr 28, 2025

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:

DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}

so that the $DRUPAL_PROJECTS_PATH environment variable can be used, if defined in .ddev/config.local.yaml, instead of the hardcoded fallback value modules/custom.

Manual Testing Instructions

ddev add-on get https://github.com/jameswilson/ddev-drupal-contrib/tarball/111-env-var-project-path

Set a custom symlink location in .ddev/config.local.yaml

web_environment:
  - ...
  - DRUPAL_PROJECTS_PATH=modules

Restart, re-symlink, then run one of the additional commands, eg eslint (if your module has custom js).

ddev restart
ddev symlink-project
ddev eslint

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.

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

Successfully merging this pull request may close these issues.

1 participant