Merge branch 'DavidSM64:master' into match_printf_func_800B452C

This commit is contained in:
tonyspumoni
2022-10-24 11:18:36 -06:00
committed by GitHub
3 changed files with 22 additions and 34 deletions
-10
View File
@@ -63,13 +63,3 @@ jobs:
- name: Verify NON_EQUIVALENT
run: make NON_EQUIVALENT=1
- name: Update decomp score in README
run: ./score.sh --update-readme
- name: Update PR
uses: test-room-7/action-update-file@v1
with:
file-path: README.md
commit-msg: Update score in README
branch: ${{ env.GITHUB_REF_NAME }}
github-token: ${{ secrets.GITHUB_TOKEN }}
+1 -24
View File
@@ -1,24 +1 @@
if [[ $1 == '--update-readme' ]]; then
export NEW_SCORE=$(python3 ./tools/python/score.py)
echo "$NEW_SCORE"
python3 - <<'EOF' > README.md.tmp
import sys
import os
import re
from datetime import datetime
BEGIN = '<!-- README_SCORE_BEGIN -->'
END = '<!-- README_SCORE_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{DATE_STR}\n```\n{os.environ["NEW_SCORE"]}\n```\n{END}',
open('README.md', 'r').read()
)
)
EOF
sed '$ { /^$/ d}' README.md.tmp > README.md # removes extra newlines at end of file
else
python3 ./tools/python/score.py "$@"
fi
python3 ./tools/python/score.py "$@"
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
export NEW_SCORE=$(python3 ./tools/python/score.py)
python3 - <<'EOF' > README.md.tmp
import sys
import os
import re
from datetime import datetime
BEGIN = '<!-- README_SCORE_BEGIN -->'
END = '<!-- README_SCORE_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{DATE_STR}\n```\n{os.environ["NEW_SCORE"]}\n```\n{END}',
open('README.md', 'r').read()
),
end=''
)
EOF
mv README.md.tmp README.md