From 6bc0c7f7352779ff3b39e5053ca62f332e4228e7 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 17 Feb 2023 22:39:14 +0100 Subject: Add script to undo a turn. --- tools/undo.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tools/undo.sh (limited to 'tools/undo.sh') diff --git a/tools/undo.sh b/tools/undo.sh new file mode 100644 index 0000000..3cd5b4a --- /dev/null +++ b/tools/undo.sh @@ -0,0 +1,10 @@ +#!/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" + node tools/patchgame.js $1 +else + echo "usage: bash tools/undo.sh GAME" +fi -- cgit v1.2.3