From 66b7f8c3621a899c03b111b65942bec2b4153e75 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:44:41 -0800 Subject: [PATCH] Cache unity process handle --- dist/platforms/windows/build.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/platforms/windows/build.ps1 b/dist/platforms/windows/build.ps1 index 3066fe2f..4052b999 100644 --- a/dist/platforms/windows/build.ps1 +++ b/dist/platforms/windows/build.ps1 @@ -161,6 +161,9 @@ $unityProcess = Start-Process -FilePath "$Env:UNITY_PATH\Editor\Unity.exe" ` -PassThru ` -NoNewWindow +# Cache the handle so exit code works properly +$unityHandle = $unityProcess.Handle + while ($true) { if ($unityProcess.HasExited) { Start-Sleep -Seconds 5