🔀 Final merge into main (#364) (#367)

Co-authored-by: Bjorn Lammers <walkxnl@gmail.com>
Co-authored-by: Prakash Palanisamy <prakash_gitea@itsprakash.in>
Co-authored-by: Prakash Palanisamy <51423001+itsprakashp@users.noreply.github.com>
Co-authored-by: Dashboard Icons Bot <noreply@walkx.fyi>
This commit is contained in:
Bjorn Lammers
2023-04-16 15:30:48 +02:00
committed by GitHub
parent 65be446af5
commit c7a85b2278
5 changed files with 58 additions and 14 deletions

10
_ci.py
View File

@@ -2,8 +2,8 @@ import pathlib
from pathlib import Path
root = pathlib.Path(__file__).parent.resolve()
template_path = root / "_TEMPLATE.md"
readme_path = root / "README.md"
icons_template_path = root / "_ICONS_TEMPLATE.md"
icons_path = root / "ICONS.md"
def generate_img_tag(file):
@@ -15,7 +15,7 @@ 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:
with open(icons_template_path, "r", encoding="UTF-8") as f:
lines = f.readlines()
# Find the line that starts with "<!-- ICONS -->"
for line in lines:
@@ -25,8 +25,8 @@ for line in lines:
# Insert the icons after the line
lines.insert(line_number + 1, " ".join(img_tags))
# Write the new file
with open(readme_path, "w", encoding="UTF-8") as f:
with open(icons_path, "w", encoding="UTF-8") as f:
f.write("".join(lines))
f.write("\n")
print("Done!")
print("Please commit the new README.md file.")
print("Please commit the new ICONS.md file.")