Skip to content

Commit 903fbce

Browse files
committed
Unzip using ZipFoundation
1 parent 1deceec commit 903fbce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/DocUploadBundle/Zipper.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import Foundation
1616

1717
import Zip
18+
import ZIPFoundation
1819

1920

2021
enum Zipper {
@@ -23,7 +24,10 @@ enum Zipper {
2324
}
2425

2526
static func unzip(from inputPath: URL, to outputPath: URL, fileOutputHandler: ((_ unzippedFile: URL) -> Void)? = nil) throws {
26-
try Zip.unzipFile(inputPath, destination: outputPath, overwrite: true, password: nil, fileOutputHandler: fileOutputHandler)
27+
// Use ZipFoundation to unzip because of an archive that can't be round-tripped with marmelroy/Zip
28+
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/3137
29+
try FileManager.default.createDirectory(at: outputPath, withIntermediateDirectories: true)
30+
try FileManager.default.unzipItem(at: inputPath, to: outputPath)
2731
}
2832
}
2933

0 commit comments

Comments
 (0)