Skip to content

Commit

Permalink
updated ReadmeLinks script with master/main change
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila committed Dec 12, 2023
1 parent 280e330 commit 9c79473
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/updateReadmeLinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def check_readme_links():

links_are_ok = True
for readme_line in readme_content:
edm4hep_objects = re.findall("\[(.*?)\]\(https:\/\/github.com\/key4hep\/EDM4hep\/blob\/master\/edm4hep\.yaml#L(\d+?)\)", readme_line)
edm4hep_objects = re.findall("\[(.*?)\]\(https:\/\/github.com\/key4hep\/EDM4hep\/blob\/main\/edm4hep\.yaml#L(\d+?)\)", readme_line)
if edm4hep_objects:
for edm4hep_object, original_line_number in edm4hep_objects:
regex = f".*edm4hep::{edm4hep_object} *: *"
Expand All @@ -32,7 +32,7 @@ def check_readme_links():
sys.exit(1)
if edm4hep_yaml_line_numbers_with_match[0] != original_line_number:
links_are_ok = False
readme_line = readme_line.replace(f"[{edm4hep_object}](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L{original_line_number})", f"[{edm4hep_object}](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L{edm4hep_yaml_line_numbers_with_match[0]})")
readme_line = readme_line.replace(f"[{edm4hep_object}](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L{original_line_number})", f"[{edm4hep_object}](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L{edm4hep_yaml_line_numbers_with_match[0]})")
print(f"{edm4hep_object} is wrongly linked (line {original_line_number} --> {edm4hep_yaml_line_numbers_with_match[0]})")
new_readme_content += readme_line
return links_are_ok, new_readme_content
Expand Down

0 comments on commit 9c79473

Please sign in to comment.