Skip to content

Commit 9a7c01c

Browse files
Add tvOS support by using caches directory instead of application support (#470)
On tvOS, `.applicationSupportDirectory` is unavailable, so switch to `.cachesDirectory` for the default database path. Also remove redundant `createDirectory` calls that are now handled by `FileManager.default.url(create:true)`.
1 parent 36137af commit 9a7c01c

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

Sources/SQLiteData/CloudKit/Internal/Metadatabase.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
open "\(url.path(percentEncoded: false))"
1717
"""
1818
)
19-
try FileManager.default.createDirectory(
20-
at: .applicationSupportDirectory,
21-
withIntermediateDirectories: true
22-
)
2319

2420
@Dependency(\.context) var context
2521
guard !url.isInMemory || context != .live

Sources/SQLiteData/CloudKit/SyncEngine.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,10 +2247,6 @@
22472247
containerIdentifier: containerIdentifier
22482248
)
22492249
let path = url.isInMemory ? url.absoluteString : url.path(percentEncoded: false)
2250-
try FileManager.default.createDirectory(
2251-
at: .applicationSupportDirectory,
2252-
withIntermediateDirectories: true
2253-
)
22542250
let database: any DatabaseWriter =
22552251
url.isInMemory
22562252
? try DatabaseQueue(path: path)

0 commit comments

Comments
 (0)