File tree Expand file tree Collapse file tree
Core/Sources/HostApp/Benchmark/Data/Repository Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import Foundation
12import Combine
23
34class LocalBenchmarkSettingsRepository : BenchmarkSettingsRepository {
45 private let localStorageManager : LocalStorageManager
56 private let benchmarkDirectoriesKey = " benchmarkDirectories "
67 private let benchmarkOutputDirectoryKey = " benchmarkOutputDirectory "
7- private let defaultOutputDirectory = " ~/Desktop/benchmark_output "
88
9+ private var defaultOutputDirectory : URL {
10+ FileManager . default. homeDirectoryForCurrentUser
11+ . appendingPathComponent ( " Desktop/benchmark_output " )
12+ }
13+
914 private let currentBenchmarkDirectories : CurrentValueSubject < [ BenchmarkDirectory ] , Never > = CurrentValueSubject ( [ ] )
1015 var benchmarkDirectories : AnyPublisher < [ BenchmarkDirectory ] , Never > {
1116 currentBenchmarkDirectories. eraseToAnyPublisher ( )
@@ -56,12 +61,11 @@ class LocalBenchmarkSettingsRepository: BenchmarkSettingsRepository {
5661 do {
5762 return try localStorageManager. load ( key: benchmarkOutputDirectoryKey)
5863 } catch LocalStorageError . noDataForKey {
59- try saveBenchmarkOutputDirectory ( defaultOutputDirectory)
60- return defaultOutputDirectory
64+ let defaultPath = defaultOutputDirectory. path
65+ try saveBenchmarkOutputDirectory ( defaultPath)
66+ return defaultPath
6167 }
62-
6368 }
64-
6569}
6670
6771extension Array where Element == BenchmarkDirectory {
You can’t perform that action at this time.
0 commit comments