diff --git a/build-update.ps1 b/build-update.ps1 index 3a52cb0..038c739 100644 --- a/build-update.ps1 +++ b/build-update.ps1 @@ -262,6 +262,10 @@ if (Test-Path $tempDir) { Remove-Item -Recurse -Force $tempDir } +if (-not (Test-Path $tempDir)) { + New-Item -ItemType Directory -Path $tempDir -Force | Out-Null +} + foreach ($f in $filesToPack) { $destPath = Join-Path $tempDir $f $destDir = Split-Path $destPath -Parent @@ -295,7 +299,16 @@ if (Test-Path $zipPath) { # Pakuj zawartosc temp dir (bez folderu temp/) $originalLocation = Get-Location Set-Location $tempDir -Compress-Archive -Path '*' -DestinationPath "../../$zipPath" -Force +$tempItems = Get-ChildItem -Force +if ($tempItems) { + Compress-Archive -Path '*' -DestinationPath "../../$zipPath" -Force +} else { + # SQL-only update: create minimal ZIP with empty placeholder + $placeholderPath = "_sql_only_update.txt" + Set-Content -Path $placeholderPath -Value "SQL-only update $versionNumber" + Compress-Archive -Path $placeholderPath -DestinationPath "../../$zipPath" -Force + Remove-Item $placeholderPath -Force +} Set-Location $originalLocation Write-Ok "Utworzono ZIP: $zipPath"