Initial commit
This commit is contained in:
22
update_admin_fa.py
Normal file
22
update_admin_fa.py
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
import re
|
||||
|
||||
html_path = 'app/templates/admin.html'
|
||||
replacement_path = 'replacement_fa.txt'
|
||||
|
||||
with open(html_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
with open(replacement_path, 'r') as f:
|
||||
new_icons_block = f.read()
|
||||
|
||||
# Regex to find the block
|
||||
pattern = r'const homelabIcons = \[.*?\];.*?\s*const fontawesomeIcons = \[.*?\];'
|
||||
|
||||
if re.search(pattern, content, re.DOTALL):
|
||||
new_content = re.sub(pattern, new_icons_block, content, flags=re.DOTALL)
|
||||
with open(html_path, 'w') as f:
|
||||
f.write(new_content)
|
||||
print("Successfully replaced icon lists.")
|
||||
else:
|
||||
print("Could not find the icon lists block to replace.")
|
||||
Reference in New Issue
Block a user