Skip to content

Commit 56ce94e

Browse files
committed
feat: use DRUPAL_PROJECTS_PATH for all commands
1 parent 01e73c5 commit 56ce94e

File tree

8 files changed

+15
-8
lines changed

8 files changed

+15
-8
lines changed

commands/web/eslint

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

10+
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1011
if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then
1112
# Configure prettier
1213
test -e .prettierrc.json || ln -s $DDEV_DOCROOT/core/.prettierrc.json .
1314
test -e .prettierignore || echo '*.yml' > .prettierignore
1415
# Change directory to the project root folder
15-
cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit
16+
cd "$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_}" || exit
1617
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/eslint" --config="../../../core/.eslintrc.passing.json" --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core --ext=.js,.yml . "$@"
1718
else
1819
echo "eslint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'"

commands/web/nightwatch

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

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

commands/web/phpcbf

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

10+
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1011
if ! command -v phpcbf >/dev/null; then
1112
echo "phpcbf is not available. You may need to 'ddev composer install'"
1213
exit 1
1314
fi
1415
test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist
15-
phpcbf -s --report-full --report-summary --report-source $DDEV_DOCROOT/modules/custom "$@"
16+
phpcbf -s --report-full --report-summary --report-source $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@"

commands/web/phpcs

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

10+
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1011
if ! command -v phpcs >/dev/null; then
1112
echo "phpcs is not available. You may need to 'ddev composer install'"
1213
exit 1
1314
fi
1415
test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist
15-
phpcs -s --report-full --report-summary --report-source $DDEV_DOCROOT/modules/custom --ignore=*/.ddev/* "$@"
16+
phpcs -s --report-full --report-summary --report-source $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH --ignore=*/.ddev/* "$@"

commands/web/phpstan

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

10+
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1011
if ! command -v phpstan >/dev/null; then
1112
echo "phpstan is not available. You may need to 'ddev poser'"
1213
exit 1
@@ -16,4 +17,4 @@ test -e phpstan.neon || curl -OL https://git.drupalcode.org/project/gitlab_templ
1617
sed -i 's/BASELINE_PLACEHOLDER/phpstan-baseline.neon/g' phpstan.neon
1718
# Add an empty baseline file to ensure it exists.
1819
test -e phpstan-baseline.neon || touch phpstan-baseline.neon
19-
phpstan analyse $DDEV_DOCROOT/modules/custom "$@"
20+
phpstan analyse $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@"

commands/web/phpunit

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

10+
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1011
if ! command -v phpunit >/dev/null; then
1112
echo "phpunit is not available. You may need to 'ddev composer install'"
1213
exit 1
@@ -18,5 +19,5 @@ if [ -f "phpunit.xml" ]; then
1819
phpunit "$@"
1920
else
2021
# Bootstrap Drupal tests and run all custom module tests.
21-
phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php $DDEV_DOCROOT/modules/custom "$@"
22+
phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@"
2223
fi

commands/web/stylelint

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

10+
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1011
if $DDEV_DOCROOT/core/node_modules/.bin/stylelint --version >/dev/null ; then
1112
# Change directory to the project root folder
12-
cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit
13+
cd "$DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH/${DDEV_SITENAME//-/_}" || exit
1314
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/stylelint" --color --config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" "./**/*.css" "$@"
1415
else
1516
echo "stylelint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'"

commands/web/symlink-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#ddev-generated
44
## Command provided by https://github.com/ddev/ddev-drupal-contrib
5-
## Description: Symlink all root files/dirs into web.modules/custom/[PROJECT_NAME]
5+
## Description: Symlink all root files/dirs into web/modules/custom/[PROJECT_NAME]
66
## Usage: symlink-project [flags] [args]
77
## Example: "ddev symlink-project"
88
## ExecRaw: true

0 commit comments

Comments
 (0)