mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-10 16:07:29 +00:00
Merge pull request #2461 from keymanapp/cherry/ios/2455/adhoc-file-overwrite
cherry(ios): Adhoc resource overwrite/file-replacement
This commit is contained in:
commit
3cea9b6861
2 changed files with 14 additions and 1 deletions
|
|
@ -3,6 +3,9 @@
|
|||
## 13.0 alpha
|
||||
* Start version 13.0
|
||||
|
||||
## 2019-12-19 12.0.63 stable
|
||||
* Fixed issue with reinstalling or updating previously installed language resources from local files (#2461)
|
||||
|
||||
## 2019-12-05 12.0.62 stable
|
||||
* Fix situation where lexical models would not install (#2420)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,11 +26,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||
var destinationUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
|
||||
destinationUrl.appendPathComponent("\(url.lastPathComponent).zip")
|
||||
do {
|
||||
try FileManager.default.copyItem(at: url, to: destinationUrl)
|
||||
let fileManager = FileManager.default
|
||||
|
||||
// For now, we'll always allow overwriting.
|
||||
if fileManager.fileExists(atPath: destinationUrl.path) {
|
||||
try fileManager.removeItem(at: destinationUrl)
|
||||
}
|
||||
|
||||
// Throws an error if the destination file already exists, and there's no
|
||||
// built-in override parameter. Hence, the previous if-block.
|
||||
try fileManager.copyItem(at: url, to: destinationUrl)
|
||||
installAdhocKeyboard(url: destinationUrl)
|
||||
return true
|
||||
} catch {
|
||||
showKMPError(KMPError.copyFiles)
|
||||
log.error(error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue