Import of zip.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jeroen Leenarts
2018-09-03 00:08:34 +02:00
parent 9bd251fe79
commit 56c543f1fc
3 changed files with 67 additions and 21 deletions
+18 -8
View File
@@ -32,14 +32,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
os_log("Failed to remove item from Inbox: %{public}@", log: Log.general, type: .error, url.absoluteString)
}
}
guard url.pathExtension == "conf" else { return false }
do {
try appCoordinator.importConfig(config: url)
} catch {
os_log("Unable to import config: %{public}@", log: Log.general, type: .error, url.absoluteString)
return false
if url.pathExtension == "conf" {
do {
try appCoordinator.importConfig(config: url)
} catch {
os_log("Unable to import config: %{public}@", log: Log.general, type: .error, url.absoluteString)
return false
}
return true
} else if url.pathExtension == "zip" {
do {
try appCoordinator.importConfigs(configZip: url)
} catch {
os_log("Unable to import config: %{public}@", log: Log.general, type: .error, url.absoluteString)
return false
}
return true
}
return true
return false
}
}