fix(gitignore): correctly grep for file with / prefix

This commit is contained in:
technofab 2025-08-27 12:01:23 +02:00
parent ed75ed6695
commit 1433186d97
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

2
.gitignore vendored
View file

@ -2,5 +2,5 @@
result result
# soonix # soonix
test.yaml /test.yaml
# end soonix # end soonix

View file

@ -203,7 +203,7 @@ in {
fi fi
# Check if file is already in gitignore # Check if file is already in gitignore
if ! grep -Fxq "$file" "$gitignore"; then if ! grep -Fxq "/$file" "$gitignore"; then
# Add sentinel comments if not present # Add sentinel comments if not present
if ! grep -q "# soonix" "$gitignore"; then if ! grep -q "# soonix" "$gitignore"; then
echo "" >> "$gitignore" echo "" >> "$gitignore"