refactor(zips): changes on how the compiler dose the zip to keep it cleaner

This commit is contained in:
2025-07-14 21:57:04 -05:00
parent b72a10db94
commit 2472374157

View File

@@ -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
}
# 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"