From 04329d840acbda333c562e5d34e5ea7ebdc22654 Mon Sep 17 00:00:00 2001 From: Revela Date: Sun, 15 Mar 2026 10:25:53 -0500 Subject: [PATCH] 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. --- Update-NightlyRelease.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Update-NightlyRelease.ps1 b/Update-NightlyRelease.ps1 index 78927c0b..2fcc4ce2 100644 --- a/Update-NightlyRelease.ps1 +++ b/Update-NightlyRelease.ps1 @@ -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