diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-05-25 20:52:06 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-06-05 11:45:00 +0200 |
commit | ab74f660dd0301995d2b71be27e89764e1ee4b5e (patch) | |
tree | b2a01bc8fc67af82486ba59479678fd26db6d49f /tools/undo.sh | |
parent | bd6644214c757a08c1c533048352a902fdefe4ae (diff) | |
download | server-ab74f660dd0301995d2b71be27e89764e1ee4b5e.tar.gz |
Remove stale stuff.
Diffstat (limited to 'tools/undo.sh')
-rw-r--r-- | tools/undo.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/undo.sh b/tools/undo.sh index 3cd5b4a..716e88b 100644 --- a/tools/undo.sh +++ b/tools/undo.sh @@ -1,9 +1,9 @@ #!/bin/bash if [ -n "$1" ] then - RID=$(sqlite3 db "select replay_id from game_replay where game_id=$1 order by replay_id desc limit 1") - echo $RID - sqlite3 db "delete from game_replay where game_id=$1 and replay_id=$RID" + COUNT=$(sqlite3 db "select count(1) from game_replay where game_id=$1") + echo Game has $COUNT actions. + sqlite3 db "delete from game_replay where game_id=$1 and replay_id=$COUNT" node tools/patchgame.js $1 else echo "usage: bash tools/undo.sh GAME" |