Skip to content

Commit 2b280a6

Browse files
committed
fix unzip & beta002
1 parent 6907793 commit 2b280a6

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### 5.0.0-beta002 - 25.09.2017
2+
* BREAKING-CHANGE: Rework Fake.Core.Target package - https://github.com/fsharp/FAKE/pull/1664
3+
* ENHANCEMENT: Update fake 5 to netcoreapp20 - https://github.com/fsharp/FAKE/pull/1678
4+
* BUGFIX: Fix Zip.Unzip
5+
16
#### 5.0.0-beta001 - 24.09.2017
27
* BREAKING-CHANGE: Rework Fake.Core.Target package - https://github.com/fsharp/FAKE/pull/1664
38
* ENHANCEMENT: Update fake 5 to netcoreapp20 - https://github.com/fsharp/FAKE/pull/1678

src/app/Fake.IO.Zip/Zip.fs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ let Unzip target (fileName : string) =
115115
use zipFile = new ZipArchive(stream)
116116
for zipEntry in zipFile.Entries do
117117
let unzipPath = Path.Combine(target, zipEntry.Name)
118-
let directoryPath = Path.GetDirectoryName(unzipPath)
119-
// create directory if needed
120-
if directoryPath.Length > 0 then Directory.CreateDirectory(directoryPath) |> ignore
121-
// unzip the file
122-
let zipStream = zipEntry.Open()
123-
if unzipPath.EndsWith "/" |> not then
124-
use unzippedFileStream = File.Create(unzipPath)
125-
zipStream.CopyTo(unzippedFileStream)
118+
if unzipPath.EndsWith "/" then
119+
Directory.CreateDirectory(unzipPath) |> ignore
120+
else
121+
// unzip the file
122+
let zipStream = zipEntry.Open()
123+
if unzipPath.EndsWith "/" |> not then
124+
use unzippedFileStream = File.Create(unzipPath)
125+
zipStream.CopyTo(unzippedFileStream)
126126

127127
#else
128128
use zipFile = new ZipFile(fileName)

0 commit comments

Comments
 (0)