Skip to content

Commit c771641

Browse files
committed
Limit metadatabase workaround to tvOS
1 parent 0eed823 commit c771641

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

Sources/SQLiteData/CloudKit/Internal/Metadatabase.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
open "\(url.path(percentEncoded: false))"
1414
"""
1515
)
16-
try FileManager.default.createDirectory(
17-
at: .applicationSupportDirectory,
18-
withIntermediateDirectories: true
19-
)
20-
16+
#if !os(tvOS)
17+
try FileManager.default.createDirectory(
18+
at: .applicationSupportDirectory,
19+
withIntermediateDirectories: true
20+
)
21+
#endif
2122
@Dependency(\.context) var context
2223
guard !url.isInMemory || context != .live
2324
else {

Sources/SQLiteData/CloudKit/SyncEngine.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,10 +2239,12 @@
22392239
containerIdentifier: containerIdentifier
22402240
)
22412241
let path = url.isInMemory ? url.absoluteString : url.path(percentEncoded: false)
2242-
try FileManager.default.createDirectory(
2243-
at: .applicationSupportDirectory,
2244-
withIntermediateDirectories: true
2245-
)
2242+
#if !os(tvOS)
2243+
try FileManager.default.createDirectory(
2244+
at: .applicationSupportDirectory,
2245+
withIntermediateDirectories: true
2246+
)
2247+
#endif
22462248
let database: any DatabaseWriter =
22472249
url.isInMemory
22482250
? try DatabaseQueue(path: path)

0 commit comments

Comments
 (0)