Skip to content

Commit

Permalink
♻️ refactor(cli): skip re-write if credits present
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Feb 11, 2024
1 parent 647cd60 commit cb1b2aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doteki/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ def insert_credits(global_config: dict[str, Any], readme_path: str) -> None:
credits = global_config.get("credits", DEFAULT_CREDITS)
readme_content = read_file_content(readme_path)

if credits != DEFAULT_CREDITS and DEFAULT_CREDITS in readme_content:
if credits in readme_content:
return
elif credits != DEFAULT_CREDITS and DEFAULT_CREDITS in readme_content:
# Replace default credits with custom ones.
readme_content = readme_content.replace(DEFAULT_CREDITS, credits)
elif credits not in readme_content:
Expand Down

0 comments on commit cb1b2aa

Please sign in to comment.