Skip to content

Commit

Permalink
wip AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Strapontin committed May 17, 2024
1 parent d2e1ff5 commit 35aa32a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion AI-helper/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ def save_role_description(file_path):

# Filters only the description
role_description = re.search(r'(?P<Description>(.|\n)+(?=Exemple))',
file_content).group('Description').strip()
file_content).group('Description').strip()

role_name = re.search(
r'(?<=\/)([^/]+)\.mdx', file_path).group(1).replace('-', ' ')

# Replaces 'Description' with 'Description "roleName"'
role_description = re.sub(
'Description', 'Description ' + role_name, role_description)

file_path = get_dest_path(file_path).replace(
'/roles/', '/roles/descriptions/')
Expand Down

0 comments on commit 35aa32a

Please sign in to comment.