mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-16 21:02:04 +00:00
Log documents migration event
If anything was moved.
This commit is contained in:
parent
9005bf6c19
commit
39fb191309
@ -90,6 +90,7 @@ class TransientStore {
|
|||||||
//
|
//
|
||||||
|
|
||||||
private static func migrateDocumentsToAppGroup() {
|
private static func migrateDocumentsToAppGroup() {
|
||||||
|
var hasMigrated = false
|
||||||
let oldDocumentsURL = FileManager.default.userURL(for: .documentDirectory, appending: nil)
|
let oldDocumentsURL = FileManager.default.userURL(for: .documentDirectory, appending: nil)
|
||||||
let newDocumentsURL = GroupConstants.App.documentsURL
|
let newDocumentsURL = GroupConstants.App.documentsURL
|
||||||
log.debug("App documentsURL: \(oldDocumentsURL)")
|
log.debug("App documentsURL: \(oldDocumentsURL)")
|
||||||
@ -106,9 +107,14 @@ class TransientStore {
|
|||||||
log.verbose("\tFROM: \(old)")
|
log.verbose("\tFROM: \(old)")
|
||||||
log.verbose("\tTO: \(new)")
|
log.verbose("\tTO: \(new)")
|
||||||
try fm.moveItem(at: old, to: new)
|
try fm.moveItem(at: old, to: new)
|
||||||
|
hasMigrated = true
|
||||||
}
|
}
|
||||||
} catch let e {
|
} catch let e {
|
||||||
|
hasMigrated = false
|
||||||
log.error("Could not migrate documents to App Group: \(e)")
|
log.error("Could not migrate documents to App Group: \(e)")
|
||||||
}
|
}
|
||||||
|
if hasMigrated {
|
||||||
|
log.debug("Documents migrated to App Group")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user