Skip to content
Snippets Groups Projects
Commit 0d88010d authored by Jasper Clemens Gräflich's avatar Jasper Clemens Gräflich
Browse files

Add some CL logging

parent 7e44d45f
No related branches found
No related tags found
No related merge requests found
Pipeline #86554 passed
......@@ -50,6 +50,7 @@ def update(new_date):
# Modify previous entry
with open(previous, "w") as file:
file.writelines(lines)
print(f"[INFO] Updated Entry: {previous}")
# Create new entry
create_entry(previous, lines[lines.index(
......@@ -58,13 +59,14 @@ def update(new_date):
# Modify MoC
with open("./journal/map-of-contents.md", "a") as moc:
moc.write(f"- [{new_date}](journal/{new_date})\n")
print("[INFO] Updated MoC")
# Modify sidebar
os.system("head -n -1 ./_sidebar.md > temp.md; mv temp.md ./_sidebar.md")
with open("./_sidebar.md", "a") as file:
file.write("[View all pages](https://gitlab1.ptb.de/graefl01/thesis/-/wikis/pages) "
f"– [Journal](journal/{new_date})\n")
print("[INFO] Updated sidebar")
def create_entry(previous, prev_tasks, day):
weekday = day.strftime("%A")
......@@ -80,6 +82,7 @@ def create_entry(previous, prev_tasks, day):
with open(f"./journal/{day}.md", 'w') as file:
file.writelines(lines)
print(f"[INFO] Created entry: {day}")
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment