Skip to content

Commit

Permalink
fix: find existing badge
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxianpeng committed Mar 15, 2024
1 parent 2833792 commit 8b8d49a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions used_by/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ def generate_rst_badge(
def get_existing_badge(file_path) -> str:
with open(file_path) as file:
file_contents = file.read()
existing_badge = re.search(
rf"\s(.*?){COMMENT_MARKER}", file_contents, re.DOTALL
)
existing_badge = re.search(rf"(.*?){COMMENT_MARKER}", file_contents, re.DOTALL)
return existing_badge.group(1).strip() if existing_badge else ""


Expand Down

0 comments on commit 8b8d49a

Please sign in to comment.