From 461d3316661e4c5a306ae68dd75d3c80a141f1ad Mon Sep 17 00:00:00 2001 From: Mike Grimes Date: Fri, 21 Oct 2022 10:03:51 -0600 Subject: [PATCH] output date string as well --- README.md | 4 ++-- score.sh | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 05ce2022..1d24e848 100755 --- a/README.md +++ b/README.md @@ -113,9 +113,9 @@ s32 is_drumstick_unlocked(void) { } ``` + As of October 3rd, 2022, this is our current score: ``` - ========================================== ADVENTURE ONE (ASM -> C Decompilation) ------------ 33.19% Complete ------------- @@ -139,8 +139,8 @@ As of October 3rd, 2022, this is our current score: ------------------------------------------ We are racing in Ancient Lake. (Lap 1/3) ========================================== - ``` + --- diff --git a/score.sh b/score.sh index a8d86991..ef5dbc63 100755 --- a/score.sh +++ b/score.sh @@ -5,12 +5,15 @@ if [[ $1 == '--update-readme' ]]; then import sys import os import re -BEGIN='' -END='' +from datetime import datetime + +BEGIN = '' +END = '' +DATE_STR = datetime.now().strftime('As of %B %-d, %Y, this is our current score:') print( re.sub( fr'(?s).{BEGIN}.*{END}', - f'\n{BEGIN}\n{os.environ["NEW_SCORE"]}\n{END}', + f'\n{BEGIN}\n{DATE_STR}\n```\n{os.environ["NEW_SCORE"]}\n```\n{END}', open('README.md', 'r').read() ) )