mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Add AppConfig.dataFolder.
This commit is contained in:
parent
09cadf7f52
commit
364da4e3cf
@ -32,6 +32,20 @@ public final class AppConfig {
|
||||
public static func cacheSubfolder(named name: String) -> URL {
|
||||
subfolder(name, in: cacheFolder)
|
||||
}
|
||||
|
||||
public static let dataFolder: URL = {
|
||||
|
||||
#if os(macOS)
|
||||
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)
|
||||
return dataFolder
|
||||
|
||||
#elseif os(iOS)
|
||||
FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
|
||||
#endif
|
||||
}()
|
||||
}
|
||||
|
||||
private extension AppConfig {
|
||||
|
Loading…
Reference in New Issue
Block a user