Skip to content

GH-177: ensure symlink-project adds /vendor/ and /web/ to gitignore - #178

Open
tormi wants to merge 1 commit into
ddev:mainfrom
tormi:GH-177
Open

GH-177: ensure symlink-project adds /vendor/ and /web/ to gitignore#178
tormi wants to merge 1 commit into
ddev:mainfrom
tormi:GH-177

Conversation

@tormi

@tormi tormi commented Aug 14, 2026

Copy link
Copy Markdown

The Issue

After running the documented Drupal contrib setup flow, .gitignore is not updated automatically with /vendor/ and /web/, which can lead to accidental commits of generated scaffold directories.

How This PR Solves The Issue

  • Updates ddev symlink-project to ensure .gitignore contains:
    • /vendor/
    • /web/
  • Keeps the behavior idempotent by appending each entry only when it is missing.
  • Preserves existing .gitignore content.

Manual Testing Instructions

ddev add-on get https://github.com/tormi/ddev-drupal-contrib/tarball/GH-177
ddev restart

Then verify:

  • Run ddev symlink-project
  • Confirm .gitignore includes /vendor/ and /web/
  • Run ddev symlink-project again and confirm no duplicate entries are added

Automated Testing Overview

  • Added a Bats test in tests/full.bats:
    • @test "ddev symlink-project updates gitignore"
  • The test validates both entries are present and confirms idempotency (single occurrence after repeated runs).
  • In this local session, full Bats execution was not completed because ./tests/bats/bin/bats was not available until submodules are initialized.

Release/Deployment Notes

  • No deployment changes required.
  • Change is limited to add-on command behavior and test coverage.
  • Backward compatible and safe for existing projects because updates are append-only when entries are absent.

@tormi tormi changed the title fix(GH-177): ensure symlink-project adds /vendor/ and /web/ to gitignore GH-177: ensure symlink-project adds /vendor/ and /web/ to gitignore Aug 14, 2026
@weitzman

Copy link
Copy Markdown
Collaborator

OK, I'll take this despite my reply in #25. Could you rework it so that we do nothing if .gitignore already exists? Lets assume the project knows what it is doing in that case.

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.

2 participants