From 2472374157b89dde94eac0aadb364f3bc84927b2 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Mon, 14 Jul 2025 21:57:04 -0500 Subject: [PATCH] refactor(zips): changes on how the compiler dose the zip to keep it cleaner --- scripts/release.ps1 | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/scripts/release.ps1 b/scripts/release.ps1 index 595ac34..ebdc51d 100644 --- a/scripts/release.ps1 +++ b/scripts/release.ps1 @@ -66,17 +66,38 @@ if ($existingZips.Count -gt $keepReleases) { Write-Host "`nPackaging release: $($zipName)" -$filesToInclude = @( - "backend\lst_backend.exe", - "frontend\.nitro", - "frontend\.tanstack", - "frontend\.output", - "frontend\public", - "package.json", - "CHANGELOG.md", - "README.md" +# Create a temporary staging directory +$tempStageDir = New-Item -ItemType Directory -Path (Join-Path $env:TEMP "lst_staging") -Force + +# Copy files to organized structure +$filesToCopy = @( + @{ Source = "backend\lst_backend.exe"; Destination = "backend\lst_backend.exe" }, + @{ Source = "LstWrapper\publish\*"; Destination = "lstwrapper\" }, + @{ Source = "frontend\.nitro"; Destination = "frontend\.nitro" }, + @{ Source = "frontend\.tanstack"; Destination = "frontend\.tanstack" }, + @{ Source = "frontend\.output"; Destination = "frontend\.output" }, + @{ Source = "frontend\public"; Destination = "frontend\public" }, + @{ Source = "package.json"; Destination = "frontend\package.json" }, + @{ Source = "CHANGELOG.md"; Destination = "CHANGELOG.md" }, + @{ Source = "README.md"; Destination = "README.md" } ) -Compress-Archive -Path $filesToInclude -DestinationPath $zipPath +foreach ($file in $filesToCopy) { + $destPath = Join-Path $tempStageDir $file.Destination + New-Item -ItemType Directory -Path (Split-Path $destPath -Parent) -Force | Out-Null + Copy-Item -Path $file.Source -Destination $destPath -Recurse -Force +} -Write-Host "`nRelease package created at: $($zipPath)" \ No newline at end of file +# Create the zip from the staged directory +Compress-Archive -Path "$tempStageDir\*" -DestinationPath $zipPath + +# Clean up temporary directory +Remove-Item $tempStageDir -Recurse -Force + +Write-Host "`nRelease package created at: $($zipPath)" +Write-Host "Organized structure:" +Write-Host "- backend/" +Write-Host "- frontend/" +Write-Host "- lstwrapper/" +Write-Host "- CHANGELOG.md" +Write-Host "- README.md" \ No newline at end of file