Skip to content

Commit

Permalink
Refactor Lunar New Year dates into constants
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnoc committed Mar 3, 2024
1 parent 9eaee43 commit c10aa27
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@

git clean -Xfd

new_years_date_2023=2023-01-22
new_years_date_2024=2024-02-10
latest_date=$(grep -P '^[0-9]{4}-[0-9]{2}-[0-9]{2}$' ./scores/scores.txt | tail -1)

python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from 2023-01-22 --to 2024-02-10
python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from 2024-02-10
python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from $new_years_date_2023 --to $new_years_date_2024
python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from $new_years_date_2024
python3 ../mahjong-scorer/mahjongscore.py ./scores/scores.txt --from $latest_date

mv "./scores/scores.txt --from 2023-01-22 --to 2024-02-10.tsv" './scores/2023.tsv'
mv "./scores/scores.txt --from 2024-02-10.tsv" './scores/2024.tsv'
mv "./scores/scores.txt --from ${new_years_date_2023} --to ${new_years_date_2024}.tsv" './scores/2023.tsv'
mv "./scores/scores.txt --from ${new_years_date_2024}.tsv" './scores/2024.tsv'
mv "./scores/scores.txt --from ${latest_date}.tsv" './scores/latest.tsv'

python3 ./res/scoring.py $latest_date
Expand Down

0 comments on commit c10aa27

Please sign in to comment.