Skip to content

Commit 7977f7b

Browse files
Add tvOS support by using caches directory instead of application support
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 79785e0 commit 7977f7b

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
@@ -13,10 +13,6 @@
1313
open "\(url.path(percentEncoded: false))"
1414
"""
1515
)
16-
try FileManager.default.createDirectory(
17-
at: .applicationSupportDirectory,
18-
withIntermediateDirectories: true
19-
)
2016

2117
@Dependency(\.context) var context
2218
guard !url.isInMemory || context != .live

Sources/SQLiteData/CloudKit/SyncEngine.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,10 +2243,6 @@
22432243
containerIdentifier: containerIdentifier
22442244
)
22452245
let path = url.isInMemory ? url.absoluteString : url.path(percentEncoded: false)
2246-
try FileManager.default.createDirectory(
2247-
at: .applicationSupportDirectory,
2248-
withIntermediateDirectories: true
2249-
)
22502246
let database: any DatabaseWriter =
22512247
url.isInMemory
22522248
? try DatabaseQueue(path: path)

0 commit comments

Comments
 (0)