Skip to content

Commit

Permalink
fix: avoid adding gitignore entry twice
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangsibecas committed Sep 20, 2024
1 parent 4df492b commit 52a2573
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/add-gitignore-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ export function addGitIgnoreEntry(host: Tree) {
let content = host.read('.gitignore', 'utf-8').trimEnd();

const ig = ignore();
ig.add(host.read('.gitignore', 'utf-8'));

if (content.includes("# Foundry")) {
return
}

ig.add(content);

content = `${content}\n\n# Foundry
cache/
Expand Down

0 comments on commit 52a2573

Please sign in to comment.