1
0
Fork 0
mirror of https://github.com/homarr-labs/dashboard-icons.git synced 2025-06-27 06:50:41 +02:00

🧑‍💻 CI & Config changes ()

Co-authored-by: Dashboard Icons Bot <noreply@walkx.fyi>
This commit is contained in:
Bjorn Lammers 2023-04-17 00:04:08 +02:00 committed by GitHub
parent 6b76af67aa
commit 50c4b5ee2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1981 changed files with 906 additions and 59219 deletions
config

32
config/ci.py Normal file
View file

@ -0,0 +1,32 @@
import pathlib
from pathlib import Path
root = pathlib.Path(__file__).parent.resolve()
template_path = root / "TEMPLATE.md"
path = root / "../ICONS.md"
def generate_img_tag(file):
return f'<img src="png/{file.name}" alt="{file.stem}" height="50">'
imgs = sorted(Path("./png").glob("*.png"))
img_tags = [generate_img_tag(x) for x in imgs]
line_number = 0
# Read the template file
with open(template_path, "r", encoding="UTF-8") as f:
lines = f.readlines()
# Find the line that starts with "<!-- ICONS -->"
for line in lines:
if line.startswith("<!-- ICONS -->"):
line_number = lines.index(line)
break
# Insert the icons after the line
lines.insert(line_number + 1, " ".join(img_tags))
# Write the new file
with open(path, "w", encoding="UTF-8") as f:
f.write("".join(lines))
f.write("\n")
print("Done!")
print("Please commit the new ICONS.md file.")