Force try in dataFolder — if we can’t get the dataFolder, we need to stop running.

This commit is contained in:
Brent Simmons 2024-07-02 21:45:43 -07:00
parent 364da4e3cf
commit 0e674d6488

View File

@ -36,10 +36,10 @@ public final class AppConfig {
public static let dataFolder: URL = {
#if os(macOS)
var dataFolder = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
var dataFolder = try! FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
dataFolder = dataFolder.appendingPathComponent(appName)
try FileManager.default.createDirectory(at: dataFolder, withIntermediateDirectories: true, attributes: nil)
try! FileManager.default.createDirectory(at: dataFolder, withIntermediateDirectories: true, attributes: nil)
return dataFolder
#elseif os(iOS)