mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Merge branch 'DavidSM64:master' into match_printf_func_800B452C
This commit is contained in:
@@ -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 +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 "$@"
|
||||
|
||||
Executable
+21
@@ -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
|
||||
Reference in New Issue
Block a user