mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-08 22:02:57 +00:00
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:
parent
77ea49440c
commit
04329d840a
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue