mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 07:45:33 +00:00
Made build script not delete logs and zips
This commit is contained in:
parent
c9a7eee188
commit
c2cc5db381
1 changed files with 10 additions and 6 deletions
|
|
@ -125,16 +125,20 @@ function Initialize-BuildDirectories {
|
|||
|
||||
Write-Host "Initializing build directories..." -ForegroundColor Cyan
|
||||
|
||||
if (Test-Path $BuildDir) {
|
||||
Remove-Item "$BuildDir\*" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
} else {
|
||||
# Ensure the root build directory exists but DO NOT delete its contents (preserve logs and zips)
|
||||
if (-not (Test-Path $BuildDir)) {
|
||||
New-Item -ItemType Directory -Path $BuildDir | Out-Null
|
||||
}
|
||||
|
||||
foreach ($platform in $PlatformsToBuild) {
|
||||
$platformDir = Join-Path $BuildDir $script:platforms[$platform].OutputSubDir
|
||||
New-Item -ItemType Directory -Path $platformDir -Force | Out-Null
|
||||
Write-Host " Created: $platformDir" -ForegroundColor Gray
|
||||
if (Test-Path $platformDir) {
|
||||
# Clear only the platform directory contents
|
||||
Remove-Item "$platformDir\*" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
} else {
|
||||
New-Item -ItemType Directory -Path $platformDir -Force | Out-Null
|
||||
}
|
||||
Write-Host " Prepared: $platformDir" -ForegroundColor Gray
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -254,7 +258,7 @@ function Create-PlatformZip {
|
|||
# Create zip
|
||||
Write-Host " Creating zip archive: $zipFileName" -ForegroundColor Cyan
|
||||
try {
|
||||
if (Test-Path $zipFilePath) { Remove-Item $zipFilePath -Force }
|
||||
# Do not explicitly delete existing zip to avoid losing historical artifacts; Compress-Archive -Force will overwrite
|
||||
Compress-Archive -Path "$platformDir\*" -DestinationPath $zipFilePath -Force
|
||||
Write-Host " Zip created: $zipFilePath" -ForegroundColor Green
|
||||
return $zipFilePath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue