feat(updater): added in a delete function for the server side

This commit is contained in:
2025-03-27 21:06:45 -05:00
parent 7b1c6e1361
commit 0ced135ec3

View File

@@ -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