28 lines
576 B
Swift
28 lines
576 B
Swift
import Foundation
|
|
|
|
struct FileService: FileServicing {
|
|
|
|
// MARK: Properties
|
|
|
|
private let fileManager: FileManager
|
|
|
|
// MARK: Initialisers
|
|
|
|
init(fileManager: FileManager = .default) {
|
|
self.fileManager = fileManager
|
|
}
|
|
|
|
// MARK: Computed
|
|
|
|
var currentFolder: URL {
|
|
get async {
|
|
if #available(macOS 13.0, *) {
|
|
.init(filePath: fileManager.currentDirectoryPath)
|
|
} else {
|
|
.init(fileURLWithPath: fileManager.currentDirectoryPath)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|