From 1d613d822602d7ea001c1d1bcea13d6d766b6564 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Mon, 23 Feb 2026 18:00:57 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20build-update.ps1=20obs=C5=82uga=20SQL-on?= =?UTF-8?q?ly=20paczek=20(0=20plik=C3=B3w)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skrypt failował przy Set-Location do temp dir który nie istniał gdy paczka nie miała plików (tylko migracja SQL). Co-Authored-By: Claude Opus 4.6 --- build-update.ps1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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"