Skip to content

Commit a614c8b

Browse files
committed
Revert "Merge pull request #23 from SwiftPackageIndex/switch-zip-library"
This reverts commit 7079392, reversing changes made to 590ca3f.
1 parent 377bfe4 commit a614c8b

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ let package = Package(
4040
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "0.1.0"),
4141
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha.1"),
4242
.package(url: "https://github.com/soto-project/soto-s3-file-transfer.git", from: "1.2.0"),
43-
.package(url: "https://github.com/weichsel/ZIPFoundation.git", from: "0.9.19"),
43+
.package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.2"),
4444
.package(url: "https://github.com/pointfreeco/swift-dependencies.git", from: "1.0.0")
4545
],
4646
targets: [
@@ -56,7 +56,7 @@ let package = Package(
5656
linkerSettings: linkerSettings
5757
),
5858
.target(name: "DocUploadBundle", dependencies: [
59-
.product(name: "ZIPFoundation", package: "zipfoundation"),
59+
.product(name: "Zip", package: "Zip"),
6060
.product(name: "Dependencies", package: "swift-dependencies")
6161
]),
6262
.testTarget(name: "DocUploadBundleTests", dependencies: ["DocUploadBundle"], exclude: ["Fixtures"]),

Sources/DocUploadBundle/Zipper.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@
1414

1515
import Foundation
1616

17-
import ZIPFoundation
17+
import Zip
1818

1919

2020
enum Zipper {
2121
static func zip(paths inputPaths: [URL], to outputPath: URL) throws {
22-
let archive = try Archive(url: outputPath, accessMode: .create)
23-
for url in inputPaths {
24-
try archive.addEntry(with: url.lastPathComponent, fileURL: url)
25-
}
22+
try Zip.zipFiles(paths: inputPaths, zipFilePath: outputPath, password: nil, progress: nil)
2623
}
2724

2825
static func unzip(from inputPath: URL, to outputPath: URL, fileOutputHandler: ((_ unzippedFile: URL) -> Void)? = nil) throws {
29-
try FileManager.default.createDirectory(at: outputPath, withIntermediateDirectories: true)
30-
try FileManager.default.unzipItem(at: inputPath, to: outputPath)
26+
try Zip.unzipFile(inputPath, destination: outputPath, overwrite: true, password: nil, fileOutputHandler: fileOutputHandler)
3127
}
3228
}
3329

0 commit comments

Comments
 (0)