Files
xtool/Sources/XUtils/DirectoryProvider.swift
Kabir Oberai 723d61902d utils: light refactoring
Undo
2026-10-28 18:14:52 -04:00

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 }
}
}