Skip to content

Prevent duplicate entries in .gitignore and .cursorignore during creation #1995

@chasefleming

Description

@chasefleming

Description:

Currently, when running the script that generates .gitignore and .cursorignore, it appends entries even if they already exist in the file. This results in duplicate entries being added repeatedly each time the script is run.

Expected Behavior:

  • The script should only add new entries if they don’t already exist in the respective ignore files.
  • If the file already contains the desired ignore entry, it should not add it again.
  • If the file contains other unrelated entries, those should remain untouched—no deletions or overrides.

Steps to Reproduce:

  1. Run the generator once — entries are added to .gitignore and .cursorignore.
  2. Run it again — the same entries are appended again, creating duplicates.

Acceptance Criteria:

  • No duplicate lines are added to .gitignore or .cursorignore.
  • Existing unrelated entries in the files are preserved.
  • Script is idempotent—running it multiple times yields the same result.

Additional Context:

This would improve clarity and prevent unnecessary file noise or git diff clutter.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions