mirror of
https://github.com/jellyfin/jellyfin-server-macos.git
synced 2024-11-23 05:59:39 +00:00
Merge pull request #28 from anthonylavado/fix-path
Create the needed cache folder
This commit is contained in:
commit
c04cf6e320
@ -21,6 +21,23 @@ var task = Process()
|
||||
button.image = NSImage(named:NSImage.Name("StatusBarButtonImage"))
|
||||
}
|
||||
|
||||
let fileManager = FileManager.default
|
||||
let home = FileManager.default.homeDirectoryForCurrentUser
|
||||
let appFolder = home.appendingPathComponent(".local/share")
|
||||
var isDirectory: ObjCBool = false
|
||||
let folderExists = fileManager.fileExists(atPath: appFolder.path,
|
||||
isDirectory: &isDirectory)
|
||||
if !folderExists || !isDirectory.boolValue {
|
||||
do {
|
||||
// 4
|
||||
try fileManager.createDirectory(at: appFolder,
|
||||
withIntermediateDirectories: true,
|
||||
attributes: nil)
|
||||
} catch {
|
||||
//failure
|
||||
}
|
||||
}
|
||||
|
||||
let path = Bundle.main.path(forAuxiliaryExecutable: "jellyfin")
|
||||
|
||||
task.launchPath = path
|
||||
|
Loading…
Reference in New Issue
Block a user