Skip to content

Commit

Permalink
create documentDirectory if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
0xh3rman committed Jun 2, 2024
1 parent 89f0584 commit e9b48d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Packages/Store/Sources/DB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public class DB: ObservableObject {
path: String,
configuration: GRDB.Configuration = DB.defaultConfiguration
) {
dbPath = URL(fileURLWithPath: String(format: "%@/%@", documentsDirectory, path))

dbPath = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true).appending(path: path)
dbQueue = try! DatabaseQueue(path: dbPath.absoluteString, configuration: configuration)

try! migrations.run(dbQueue: dbQueue)
Expand Down

0 comments on commit e9b48d3

Please sign in to comment.