Skip to content

Commit 7726869

Browse files
committed
Fixed issue with importing the dat files into the zip.
1 parent 7d3f7d8 commit 7726869

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

goodluck.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ foreach($iarEntry in $iarEntries) {
4343
$iarEntry = $packageArchive.CreateEntry($fullname)
4444

4545
if($fullname.StartsWith("files")) {
46-
$writer = New-Object System.IO.StreamWriter($iarEntry.Open())
4746
$name = [System.IO.Path]::GetFileName($fullname)
48-
$content = Get-Content -Path (Join-Path -Path ".\cli\_out" -ChildPath $name) -Raw
49-
$writer.Write($content)
50-
$writer.Dispose()
51-
$writer.Close()
47+
$content = [System.IO.File]::ReadAllBytes((Join-Path -Path ".\cli\_out" -ChildPath $name))
48+
$ms = New-Object System.IO.MemoryStream(,$content)
49+
$zipStream = $iarEntry.Open()
50+
$ms.CopyTo($zipStream)
51+
$zipStream.Dispose()
52+
$zipStream.Close()
53+
$ms.Dispose()
54+
$ms.Close()
5255
}
5356
}
5457

0 commit comments

Comments
 (0)