ensure we create our token folder on login

This commit is contained in:
a. fox 2024-02-16 15:59:31 -05:00
parent 92b54d04c5
commit 6abcaf82c2
1 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,15 @@ extension Seanut {
var password: String?
mutating func run() async {
let seanutCacheFolder = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent(".seanut/")
if !FileManager.default.fileExists(atPath: seanutCacheFolder.absoluteString) {
do {
try FileManager.default.createDirectory(at: seanutCacheFolder, withIntermediateDirectories: false)
} catch {
fatalError("could not create seanut token cache folder. quitting...")
}
}
let client = JellyfinClient(
configuration: Seanut.generateJellyfinConfiguration(url: options.domain.toURL()!)
)