Add support for empty directory entries in ZIP archive

This commit introduces a new block in the `Update-NightlyRelease.ps1` script that creates empty directory entries in the ZIP archive. A `try` block is added to manage the `ZipArchive` object, and a loop iterates through all directories in the specified `$ReleaseDir`, ensuring that empty directories are included in the final archive.
This commit is contained in:
Revela 2026-03-15 10:25:53 -05:00
parent 77ea49440c
commit 04329d840a

View file

@ -71,6 +71,15 @@ try {
try {
$basePath = (Resolve-Path $ReleaseDir).Path
# Add empty directories so they exist when extracted
Get-ChildItem -Path $basePath -Recurse -Directory | ForEach-Object {
$dirFullPath = $_.FullName
$relativePath = $dirFullPath.Substring($basePath.Length).TrimStart('\','/')
$entryName = ($topLevelFolder + "/" + ($relativePath -replace '\\','/') + "/")
# Creating an entry with a trailing slash makes an empty directory in the zip
$zip.CreateEntry($entryName) | Out-Null
}
Get-ChildItem -Path $basePath -Recurse -File | ForEach-Object {
$fullPath = $_.FullName