feat(updater): added in a delete function for the server side
This commit is contained in:
@@ -86,7 +86,33 @@ $plantFunness = {
|
|||||||
$serverFile = "$($localPath)\$buildFile"
|
$serverFile = "$($localPath)\$buildFile"
|
||||||
$serverPath = "$($localPath)"
|
$serverPath = "$($localPath)"
|
||||||
|
|
||||||
|
|
||||||
Write-Host "In the plant we go!!!!!"
|
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..."
|
Write-Host "Unzipping the folder..."
|
||||||
|
|
||||||
$extractedFolderPath = $serverPath
|
$extractedFolderPath = $serverPath
|
||||||
|
|||||||
Reference in New Issue
Block a user