From 36fb3300bb588082c2bfcf6b1a822f2575a5042f Mon Sep 17 00:00:00 2001 From: Daniel Machado Date: Wed, 15 Jul 2026 21:28:48 +0200 Subject: [PATCH] Harden playtest launcher: don't abort on non-fatal git pull stderr Run the fast-forward pull under $ErrorActionPreference='Continue' so a blocked or diverged pull writing to stderr doesn't throw under the launcher's 'Stop' preference and abort before the play-working-tree fallback can run. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/playtest.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/playtest.ps1 b/scripts/playtest.ps1 index 399fc11..766695e 100644 --- a/scripts/playtest.ps1 +++ b/scripts/playtest.ps1 @@ -9,13 +9,16 @@ Write-Host "=== TankGame play test ===" -ForegroundColor Cyan Write-Host "Repo: $repo`n" # 1. Fetch the latest committed version (fast-forward only; never clobbers local work). +# Run git where stderr is NOT a terminating error: a blocked or diverged pull writes to +# stderr, and under $ErrorActionPreference='Stop' that throws and aborts the launcher +# before the "play current working tree" fallback below can run. Write-Host "Updating to latest version..." -ForegroundColor Yellow -git -C $repo pull --ff-only 2>&1 | Write-Host +& { $ErrorActionPreference = 'Continue'; git -C $repo pull --ff-only 2>&1 | Write-Host } if ($LASTEXITCODE -ne 0) { Write-Host "Could not fast-forward (offline, or local changes present) - playing current working tree." -ForegroundColor DarkYellow } -# 2. Resolve Godot 4.6 (.NET) — PATH shim first, then the known winget install. +# 2. Resolve Godot 4.6 (.NET) - PATH shim first, then the known winget install. $godot = (Get-Command godot -ErrorAction SilentlyContinue).Source if (-not $godot) { $godot = Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Packages\GodotEngine.GodotEngine.Mono_Microsoft.Winget.Source_8wekyb3d8bbwe\Godot_v4.6.2-stable_mono_win64\Godot_v4.6.2-stable_mono_win64.exe'