From 932d40ac92795b4635b7c81a1f8f34492cdc2fcf Mon Sep 17 00:00:00 2001 From: david-swift Date: Tue, 8 Oct 2024 15:41:48 +0200 Subject: [PATCH] Use file URL initializer for creating directory --- Sources/State.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Sources/State.swift b/Sources/State.swift index 4ff2343..a123d8a 100644 --- a/Sources/State.swift +++ b/Sources/State.swift @@ -73,12 +73,10 @@ public enum DatabaseInformation { if let privateConnection { return privateConnection } - if let url = URL(string: path) { - try? FileManager.default.createDirectory( - at: url.deletingLastPathComponent(), - withIntermediateDirectories: true - ) - } + try? FileManager.default.createDirectory( + at: URL(fileURLWithPath: path).deletingLastPathComponent(), + withIntermediateDirectories: true + ) let connection = try? Connection(path) privateConnection = connection _ = try? connection?.run(table.create { table in