Skip to content

Commit

Permalink
Bug fix. If we specified a file with a dot, it is automatically added…
Browse files Browse the repository at this point in the history
… to .gitignore
  • Loading branch information
morington committed Jun 30, 2024
1 parent 7c55bfe commit 9b69002
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions confhub/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from confhub.core.block import BlockCore
from confhub.core.fields import ConfigurationField
from confhub.utils.gitignore import add_to_gitignore

logger: structlog.BoundLogger = structlog.get_logger("confhub")

Expand Down Expand Up @@ -67,4 +68,7 @@ def create_files(self, config_path: Path) -> None:
with open(file_path, 'w', encoding='utf-8') as file:
yaml.dump(data, file, default_flow_style=False)

if filename.startswith('.'):
add_to_gitignore(f"{filename}.*")

logger.info("Create file", path=file_path)
2 changes: 0 additions & 2 deletions confhub/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,4 @@ def generate_models() -> None:

ConfigurationBuilder(*models).create_files(Path.cwd() / Path(_config_path))

add_to_gitignore('.secrets.*')

logger.info("Configuration successfully generated")

0 comments on commit 9b69002

Please sign in to comment.