Skip to content

Commit 19f27da

Browse files
committed
refactor: centralize DRUPAL_PROJECTS_PATH in config
- Move DRUPAL_PROJECTS_PATH to config.contrib.yaml - Remove individual definitions from command files - Improve documentation for theme support
1 parent 56ce94e commit 19f27da

File tree

10 files changed

+9
-9
lines changed

10 files changed

+9
-9
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ web_environment:
9696
- DRUPAL_PROJECTS_PATH=modules
9797
```
9898

99-
Then restart DDEV by running `ddev restart`.
99+
Then run `ddev restart` and then `ddev symlink-project` to update the symlink location.
100+
101+
All [ddev-drupal-contrib commands](#commands) run against your project code in the configured symlink location.
102+
103+
To use with Drupal themes, set `DRUPAL_PROJECTS_PATH=themes/custom` in your config.
100104

101105
## Example of successful test
102106

commands/web/eslint

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
## Example: "ddev eslint"
88
## ExecRaw: true
99

10-
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1110
if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then
1211
# Configure prettier
1312
test -e .prettierrc.json || ln -s $DDEV_DOCROOT/core/.prettierrc.json .

commands/web/nightwatch

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
## Example: "ddev nightwatch"
88
## ExecRaw: true
99

10-
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1110
yarn --cwd "$DDEV_DOCROOT/core" test:nightwatch "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/" "$@"

commands/web/phpcbf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
## Example: "ddev phpcbf" or "ddev phpcbf -n"
88
## ExecRaw: true
99

10-
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1110
if ! command -v phpcbf >/dev/null; then
1211
echo "phpcbf is not available. You may need to 'ddev composer install'"
1312
exit 1

commands/web/phpcs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
## Example: "ddev phpcs" or "ddev phpcs -n"
88
## ExecRaw: true
99

10-
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1110
if ! command -v phpcs >/dev/null; then
1211
echo "phpcs is not available. You may need to 'ddev composer install'"
1312
exit 1

commands/web/phpstan

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
## Example: "ddev phpstan" or "ddev phpstan -n"
88
## ExecRaw: true
99

10-
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1110
if ! command -v phpstan >/dev/null; then
1211
echo "phpstan is not available. You may need to 'ddev poser'"
1312
exit 1

commands/web/phpunit

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
## Example: "ddev phpunit" or "ddev phpunit --stop-on-failure"
88
## ExecRaw: true
99

10-
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1110
if ! command -v phpunit >/dev/null; then
1211
echo "phpunit is not available. You may need to 'ddev composer install'"
1312
exit 1

commands/web/stylelint

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
## Example: "ddev stylelint"
88
## ExecRaw: true
99

10-
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1110
if $DDEV_DOCROOT/core/node_modules/.bin/stylelint --version >/dev/null ; then
1211
# Change directory to the project root folder
1312
cd "$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_}" || exit

commands/web/symlink-project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
## ExecRaw: true
99

1010
export _WEB_ROOT=$DDEV_DOCROOT
11-
export DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1211
#todo use more dynamic ref.
1312
cd "$DDEV_COMPOSER_ROOT" || exit
1413
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/symlink_project.php

config.contrib.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#ddev-generated
22
## Command provided by https://github.com/ddev/ddev-drupal-contrib
3+
## To customize this configuration, see:
4+
## https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/
35
web_environment:
46
# To change the Drupal core version, see the README:
57
# https://github.com/ddev/ddev-drupal-contrib/blob/main/README.md#changing-the-drupal-core-version
@@ -8,6 +10,8 @@ web_environment:
810
- SIMPLETEST_BASE_URL=http://web
911
- BROWSERTEST_OUTPUT_DIRECTORY=/tmp
1012
- BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL}
13+
# To change the symlink location, see: https://github.com/ddev/ddev-drupal-contrib/blob/main/README.md#changing-the-symlink-location
14+
- DRUPAL_PROJECTS_PATH=modules/custom
1115
hooks:
1216
post-start:
1317
- exec-host: |

0 commit comments

Comments
 (0)