Rework path storage, add start screen

This commit is contained in:
Christoph Hagen
2024-12-17 23:05:45 +01:00
parent 849585acc7
commit 9a53e020a7
21 changed files with 408 additions and 229 deletions

View File

@ -2,12 +2,6 @@ import Foundation
final class PathSettings: ObservableObject {
@Published
var contentDirectoryPath: String
@Published
var outputDirectoryPath: String
@Published
var assetsOutputFolderPath: String
@ -27,9 +21,7 @@ final class PathSettings: ObservableObject {
var tagsOutputFolderPath: String
init(file: PathSettingsFile) {
self.contentDirectoryPath = file.contentDirectoryPath
self.assetsOutputFolderPath = file.assetsOutputFolderPath
self.outputDirectoryPath = file.outputDirectoryPath
self.pagesOutputFolderPath = file.pagesOutputFolderPath
self.imagesOutputFolderPath = file.imagesOutputFolderPath
self.filesOutputFolderPath = file.filesOutputFolderPath
@ -38,9 +30,7 @@ final class PathSettings: ObservableObject {
}
var file: PathSettingsFile {
.init(contentDirectoryPath: contentDirectoryPath,
outputDirectoryPath: outputDirectoryPath,
assetsOutputFolderPath: assetsOutputFolderPath,
.init(assetsOutputFolderPath: assetsOutputFolderPath,
pagesOutputFolderPath: pagesOutputFolderPath,
imagesOutputFolderPath: imagesOutputFolderPath,
filesOutputFolderPath: filesOutputFolderPath,

View File

@ -36,8 +36,4 @@ final class Settings: ObservableObject {
case .german: return german
}
}
var outputDirectory: URL {
URL(fileURLWithPath: paths.outputDirectoryPath)
}
}