mirror of
https://github.com/xtool-org/xtool.git
synced 2026-02-04 11:53:30 +01:00
19 lines
530 B
Swift
19 lines
530 B
Swift
import Foundation
|
|
import Dependencies
|
|
|
|
private struct PersistentDirectoryProvider: DependencyKey, Sendable {
|
|
var directory: URL
|
|
|
|
static let liveValue = PersistentDirectoryProvider(
|
|
directory: URL(fileURLWithPath: NSHomeDirectory())
|
|
.appendingPathComponent(".config/xtool")
|
|
)
|
|
}
|
|
|
|
extension DependencyValues {
|
|
public var persistentDirectory: URL {
|
|
get { self[PersistentDirectoryProvider.self].directory }
|
|
set { self[PersistentDirectoryProvider.self].directory = newValue }
|
|
}
|
|
}
|