From 597f5758a128dbd72bd5cc7f9f7a228a11fc2729 Mon Sep 17 00:00:00 2001 From: Mo Langning <133737702+molangning@users.noreply.github.com> Date: Thu, 30 Nov 2023 00:03:49 +0800 Subject: [PATCH] patched away faulty checks and replacements --- .bin/get-and-patch-readme-repository-details.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.bin/get-and-patch-readme-repository-details.py b/.bin/get-and-patch-readme-repository-details.py index cadab904..51876491 100755 --- a/.bin/get-and-patch-readme-repository-details.py +++ b/.bin/get-and-patch-readme-repository-details.py @@ -51,11 +51,11 @@ DETAIL_USER_NOTICE_STRING=DETAIL_USER_NOTICE_STRING%(DETAILS_ANCHOR,final_size,e readme_contents=open("README.md").read() -if re.match(DETAILS_ANCHOR_REGEX,readme_contents,flags=re.DOTALL): - print("[!] Error: No details anchor found!") +if not re.search(DETAILS_ANCHOR_REGEX,readme_contents,flags=re.DOTALL): + print_err("README.md", "[!] Error: No details anchor found!") exit(2) -readme_contents=re.sub(DETAILS_ANCHOR_REGEX,DETAIL_USER_NOTICE_STRING,readme_contents,flags=re.DOTALL) +readme_contents=re.sub(DETAILS_ANCHOR_REGEX,DETAIL_USER_NOTICE_STRING,readme_contents,count=1,flags=re.DOTALL) open("README.md","w").write(readme_contents) print("[+] Wrote README.md!")