Don't add .env to gitignore when it doesn't exist.

This commit is contained in:
apaz-cli 2024-12-20 10:09:07 -06:00
parent eb9c41f2a0
commit bcdc0217b3

View file

@ -173,6 +173,7 @@ def check_gitignore(git_root, io, ask=True):
existing_lines = content.splitlines()
for pat in patterns:
if pat not in existing_lines:
if '*' in pat or (Path(git_root) / pat).exists():
patterns_to_add.append(pat)
except OSError as e:
io.tool_error(f"Error when trying to read {gitignore_file}: {e}")