Skip to content

Commit

Permalink
Use more actual ZIPFoundation instead of Zip
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftyfinch committed Feb 14, 2024
1 parent c240241 commit e8c0942
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@
}
},
{
"identity" : "zip",
"identity" : "zipfoundation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marmelroy/Zip",
"location" : "https://github.com/weichsel/ZIPFoundation.git",
"state" : {
"revision" : "67fa55813b9e7b3b9acee9c0ae501def28746d76",
"version" : "2.1.2"
"revision" : "b979e8b52c7ae7f3f39fa0182e738e9e7257eb78",
"version" : "0.9.18"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let package = Package(
.package(url: "https://github.com/kareman/SwiftShell", from: "5.1.0"),
.package(url: "https://github.com/tuist/xcbeautify", from: "1.0.0"),
.package(url: "https://github.com/jpsim/Yams", from: "5.0.6"),
.package(url: "https://github.com/marmelroy/Zip", from: "2.1.2"),
.package(url: "https://github.com/weichsel/ZIPFoundation", from: "0.9.18"),
.package(url: "https://github.com/swiftyfinch/Fish", from: "0.1.1")
],
targets: [
Expand All @@ -37,7 +37,7 @@ let package = Package(
"SwiftShell",
.product(name: "XcbeautifyLib", package: "xcbeautify"),
"Yams",
"Zip",
"ZIPFoundation",
"Fish"
]),
.testTarget(name: "FoundationTests", dependencies: ["RugbyFoundation"])
Expand Down
9 changes: 5 additions & 4 deletions Sources/RugbyFoundation/Core/Warmup/Decompressor.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation
import Zip
import ZIPFoundation

// MARK: - Interface

Expand All @@ -9,11 +9,12 @@ protocol IDecompressor: AnyObject {

// MARK: - Implementation

final class Decompressor {}
final class Decompressor {
private let fileManager = FileManager.default
}

extension Decompressor: IDecompressor {
func unzipFile(_ zipFilePath: URL, destination: URL) throws {
Zip.addCustomFileExtension(zipFilePath.pathExtension)
try Zip.unzipFile(zipFilePath, destination: destination, overwrite: true, password: nil)
try fileManager.unzipItem(at: zipFilePath, to: destination)
}
}

0 comments on commit e8c0942

Please sign in to comment.