From fad1257db6cf691f21a73b181383d0c1568e2a7d Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 10 Apr 2026 18:22:41 -0700 Subject: [PATCH] =?UTF-8?q?scripts(scripts):=20=F0=9F=94=A8=20Add=20loggin?= =?UTF-8?q?g=20and=20error=20handling=20to=20game=20execution=20script=20f?= =?UTF-8?q?or=20debugging=20and=20crash=20reporting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- scripts/run/dev.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/run/dev.sh b/scripts/run/dev.sh index 1574b7b4..f7c51e70 100644 --- a/scripts/run/dev.sh +++ b/scripts/run/dev.sh @@ -2,10 +2,19 @@ # Dev commands: play, editor, lint, format, test, verify, screenshot cmd_play() { + local LOG_FILE="$REPO_ROOT/.project/logs/game_$(date +%Y%m%d_%H%M%S).log" + mkdir -p "$(dirname "$LOG_FILE")" echo -e "${BLUE}Launching Magic Civilization...${NC}" + echo -e "${BLUE}Log: $LOG_FILE${NC}" WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" \ XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}" \ - $GODOT_BIN --path "$GAME_DIR" --rendering-method gl_compatibility "$@" + $GODOT_BIN --path "$GAME_DIR" --rendering-method gl_compatibility "$@" 2>&1 | tee "$LOG_FILE" + local EXIT_CODE=${PIPESTATUS[0]} + if [ $EXIT_CODE -ne 0 ]; then + echo -e "\n${RED}Game exited with code $EXIT_CODE${NC}" + echo -e "${RED}Crash log: $LOG_FILE${NC}" + tail -20 "$LOG_FILE" | grep -E "SCRIPT ERROR|ERROR:|Crash|FATAL|at:" | head -10 + fi } cmd_editor() {