Skip to content

Commit 787b968

Browse files
committed
Hide Credentials
1 parent 1d86782 commit 787b968

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import sys
2+
from pathlib import Path
3+
4+
5+
files_to_ignore_text = '''
6+
# Warning! Files in the below section contain your credentials!
7+
# Credentials should never be pushed to the repository.
8+
cookiecutter-config-file.yml
9+
*.env
10+
'''
11+
12+
gitignore = Path("./.gitignore")
13+
if not gitignore.exists():
14+
# We should assume this file exists otherwise something went wrong
15+
sys.exit(1)
16+
17+
existing_gitignore_text = gitignore.read_text()
18+
gitignore.write_text(existing_gitignore_text + files_to_ignore_text)
19+
20+
sys.exit(0)

0 commit comments

Comments
 (0)