Skip to content

Commit

Permalink
Improve file handler
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Sep 29, 2024
1 parent 4f0debd commit 1e23b68
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Sources/Zip/Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,8 @@ public class Zip {
progressHandler((currentPosition / totalSize))
}

if let fileHandler = fileOutputHandler,
let encodedString = fullPath.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
#if os(Windows)
let fileUrlString = "file:///\(encodedString)"
#else
let fileUrlString = encodedString
#endif
if let fileUrl = URL(string: fileUrlString) {
fileHandler(fileUrl)
}
if let fileHandler = fileOutputHandler {
fileHandler(URL(fileURLWithPath: fullPath, isDirectory: false))
}

progressTracker.completedUnitCount = Int64(currentPosition)
Expand Down

0 comments on commit 1e23b68

Please sign in to comment.