Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions commands/web/symlink-project
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ fi
export DRUPAL_PROJECT_FOLDER=${DDEV_DOCROOT}/${DRUPAL_PROJECTS_PATH}/${DDEV_SITENAME//-/_}
php symlink_project.php
rm -f symlink_project.php

# Ensure generated Drupal scaffold paths are ignored in contrib repositories.
touch .gitignore
for pattern in "/vendor/" "/web/"; do
if ! grep -Fxq "$pattern" .gitignore; then
printf "%s\n" "$pattern" >> .gitignore
fi
done
10 changes: 10 additions & 0 deletions tests/full.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ teardown_file() {
ls -la web/modules/custom/test_drupal_contrib/test_drupal_contrib.info.yml
}

@test "ddev symlink-project updates gitignore" {
touch .gitignore
run -0 ddev symlink-project
run -0 ddev symlink-project
run -0 grep -Fx "/vendor/" .gitignore
run -0 grep -Fx "/web/" .gitignore
run -0 sh -c '[ "$(grep -c -Fx "/vendor/" .gitignore)" -eq 1 ]'
run -0 sh -c '[ "$(grep -c -Fx "/web/" .gitignore)" -eq 1 ]'
}

@test "php tools availability" {
ddev phpcs --version
ddev phpstan --version
Expand Down