From 0ced135ec38590fd599e9a45542768b3790eb3db Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Thu, 27 Mar 2025 21:06:45 -0500 Subject: [PATCH] feat(updater): added in a delete function for the server side --- server/scripts/update.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/server/scripts/update.ps1 b/server/scripts/update.ps1 index 1a78291..5083393 100644 --- a/server/scripts/update.ps1 +++ b/server/scripts/update.ps1 @@ -86,7 +86,33 @@ $plantFunness = { $serverFile = "$($localPath)\$buildFile" $serverPath = "$($localPath)" + Write-Host "In the plant we go!!!!!" + + ###################################################################################### + # Removing the fist and frontend folder to make sure we keep them the same and clean. + ###################################################################################### + try { + # Delete the directories after extraction + Write-Host "Deleting Dist and Frontend..." + + $distPath = "$serverPath\dist\" + $frontendPath = "$serverPath\frontend\" + + if (Test-Path $distPath) { + Remove-Item -Path $distPath -Recurse -Force + + } + + if (Test-Path $frontendPath) { + Remove-Item -Path $frontendPath -Recurse -Force + } + + } catch { + Write-Host "Error: $_" + exit 1 # Exit with a non-zero code if there's an error + } + Write-Host "Unzipping the folder..." $extractedFolderPath = $serverPath