mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Removes files if unzip is not successful
This commit is contained in:
@@ -230,9 +230,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
private func unzipFile(at location: URL) throws -> URL {
|
||||
var unzippedDir = location.deletingLastPathComponent()
|
||||
unzippedDir.appendPathComponent("newtheme.nnwtheme")
|
||||
try Zip.unzipFile(location, destination: unzippedDir, overwrite: true, password: nil, progress: nil, fileOutputHandler: nil)
|
||||
try FileManager.default.removeItem(at: location)
|
||||
return unzippedDir
|
||||
do {
|
||||
try Zip.unzipFile(location, destination: unzippedDir, overwrite: true, password: nil, progress: nil, fileOutputHandler: nil)
|
||||
try FileManager.default.removeItem(at: location)
|
||||
return unzippedDir
|
||||
} catch {
|
||||
try? FileManager.default.removeItem(at: location)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
private func renameFileToThemeName(at location: URL) throws -> URL {
|
||||
|
||||
Reference in New Issue
Block a user