Skip to content

Commit

Permalink
almost done
Browse files Browse the repository at this point in the history
  • Loading branch information
oyetanishq committed Aug 1, 2024
1 parent 9ac4d37 commit a01ddac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_chess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
game_status=$(python3 logic/check_game_status.py "$game_fen")
jq --arg a "$game_fen" --arg b "$game_status" '.current_game_fen = $a | .stats.current_game = $b' game.json > temp.json && mv temp.json game.json
jq --arg a "$username" --arg b "${move:0:2}" --arg c "${move:2}" --arg d "$datetime" -r '.moves_history |= [{"datetime": $d, "human": {"username": $a, "from": $b, "to": $c}}] + .[0:-1]' game.json > temp.json && mv temp.json game.json
jq --arg a "$username" --arg b "${move:0:2}" --arg c "${move:2}" --arg d "$datetime" -r '.moves_history |= if length >= 5 then [{"datetime": $d, "human": {"username": $a, "from": $b, "to": $c}}] + .[0:-1] else [{"datetime": $d, "human": {"username": $a, "from": $b, "to": $c}}] + .[0:] end' game.json > temp.json && mv temp.json game.json
if [ "$game_status" == "stillon" ]; then
echo "gameover=no" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion render/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def list_to_markdown(history_list):
stockfish_from = move['stockfish']['from']
stockfish_to = move['stockfish']['to']

markdown.append(f'|{i + 1}|`{datetime_obj.strftime("%d/%m/%y")}` `{datetime_obj.strftime("%H:%M:%S")}`|<img src="https://github.com/{username}.png" height="50px" /> | [`{username}`](https://github.com/{username})|`{username_from}`|`{username_to}`|`{stockfish_from}`|`{stockfish_to}`|')
markdown.append(f'|{i + 1}|`{datetime_obj.strftime("%d/%m/%y")}`, `{datetime_obj.strftime("%H:%M:%S")}`|<img src="https://github.com/{username}.png" height="50px" /> | [`{username}`](https://github.com/{username})|`{username_from}`|`{username_to}`|`{stockfish_from}`|`{stockfish_to}`|')

return markdown

Expand Down
2 changes: 1 addition & 1 deletion render/moves.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def list_to_markdown(move_list):

for i in range(0, len(move_list[from_move])):
to_move = move_list[from_move][i]
line += f"[{to_move}](https://github.com/tanishq-singh-2407/tanishq-singh-2407/issues/new?title=chess_move_{from_move}{to_move}&labels=make+move&body=Just+push+%27Submit+new+issue%27.+You+don%27t+need+to+do+anything+else.), "
line += f"[{to_move}](https://github.com/tanishq-singh-2407/readme-chess/issues/new?title=chess_move_{from_move}{to_move}&labels=make+move&body=Just+push+%27Submit+new+issue%27.+You+don%27t+need+to+do+anything+else.), "

line = line[:-2] + " |"
markdown_lines.append(line)
Expand Down

0 comments on commit a01ddac

Please sign in to comment.