Update the modification date in the leaderboard index page based on the latest modification time of the related files

This commit is contained in:
Paul Gauthier (aider) 2024-07-29 13:13:56 -03:00
parent 2ec8099319
commit a67da8a133

View file

@ -11,9 +11,15 @@ last updated
import os
import datetime
file_path = 'aider/website/docs/leaderboards/index.md'
mod_time = os.path.getmtime(file_path)
mod_date = datetime.datetime.fromtimestamp(mod_time)
files = [
'aider/website/docs/leaderboards/index.md',
'aider/website/_data/edit_leaderboard.yml',
'aider/website/_data/refactor_leaderboard.yml'
]
mod_times = [os.path.getmtime(file) for file in files]
latest_mod_time = max(mod_times)
mod_date = datetime.datetime.fromtimestamp(latest_mod_time)
cog.out(f"{mod_date.strftime('%B %d, %Y.')}")
]]]-->
July 29, 2024.