From 1f6637c512dcd465c5000f8d1baaa8e76766edc1 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Thu, 21 May 2026 21:51:21 -0500 Subject: [PATCH] fix(build): crashes when files changed :( BREAKING CHANGE: gives a rabbit hole error closes #24 --- scripts/updateServer.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/updateServer.ps1 b/scripts/updateServer.ps1 index d76666b..9787733 100644 --- a/scripts/updateServer.ps1 +++ b/scripts/updateServer.ps1 @@ -180,6 +180,23 @@ function Update-Server { Stop-Service -DisplayName $app_name -Force Start-Sleep -Seconds 1 + Write-Host "Removing old server" + + # Remove old dist folder before extracting + $DistPath = Join-Path $LocalPath "dist" + + if (Test-Path $DistPath) { + Write-Host "Removing old dist folder..." + + try { + Remove-Item $DistPath -Recurse -Force + } + catch { + Write-Host "Failed to remove dist folder: $_" + exit 1 + } + } + Write-Host "Unzipping the folder..." try {