Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Palm <git@palmdevs.me>
16 lines
577 B
Swift
16 lines
577 B
Swift
import Foundation
|
|
|
|
func getPyoncordDirectory() -> URL {
|
|
let documentDirectoryURL = try! FileManager.default.url(
|
|
for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
|
|
|
|
let pyoncordFolderURL = documentDirectoryURL.appendingPathComponent("pyoncord")
|
|
|
|
// Create the "pyoncord" folder if it doesn't exist
|
|
if !FileManager.default.fileExists(atPath: pyoncordFolderURL.path) {
|
|
try! FileManager.default.createDirectory(
|
|
at: pyoncordFolderURL, withIntermediateDirectories: true, attributes: nil)
|
|
}
|
|
|
|
return pyoncordFolderURL
|
|
}
|