mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:55:35 +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
|
Write-Host "Initializing build directories..." -ForegroundColor Cyan
|
||||||
|
|
||||||
if (Test-Path $BuildDir) {
|
# Ensure the root build directory exists but DO NOT delete its contents (preserve logs and zips)
|
||||||
Remove-Item "$BuildDir\*" -Recurse -Force -ErrorAction SilentlyContinue
|
if (-not (Test-Path $BuildDir)) {
|
||||||
} else {
|
|
||||||
New-Item -ItemType Directory -Path $BuildDir | Out-Null
|
New-Item -ItemType Directory -Path $BuildDir | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($platform in $PlatformsToBuild) {
|
foreach ($platform in $PlatformsToBuild) {
|
||||||
$platformDir = Join-Path $BuildDir $script:platforms[$platform].OutputSubDir
|
$platformDir = Join-Path $BuildDir $script:platforms[$platform].OutputSubDir
|
||||||
|
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
|
New-Item -ItemType Directory -Path $platformDir -Force | Out-Null
|
||||||
Write-Host " Created: $platformDir" -ForegroundColor Gray
|
}
|
||||||
|
Write-Host " Prepared: $platformDir" -ForegroundColor Gray
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,7 +258,7 @@ function Create-PlatformZip {
|
||||||
# Create zip
|
# Create zip
|
||||||
Write-Host " Creating zip archive: $zipFileName" -ForegroundColor Cyan
|
Write-Host " Creating zip archive: $zipFileName" -ForegroundColor Cyan
|
||||||
try {
|
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
|
Compress-Archive -Path "$platformDir\*" -DestinationPath $zipFilePath -Force
|
||||||
Write-Host " Zip created: $zipFilePath" -ForegroundColor Green
|
Write-Host " Zip created: $zipFilePath" -ForegroundColor Green
|
||||||
return $zipFilePath
|
return $zipFilePath
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue