Add all resources, change paths

This commit is contained in:
Christoph Hagen
2022-02-10 16:18:50 +01:00
parent 7d49e8a7ed
commit 4e7e01f203
8 changed files with 85 additions and 21 deletions

View File

@ -96,15 +96,11 @@ public func configure(_ app: Application) throws {
let configFile = URL(fileURLWithPath: app.directory.resourcesDirectory)
.appendingPathComponent("paths.conf")
let configData = try String(contentsOf: configFile)
.components(separatedBy: "\n")
.map { $0.trimmingCharacters(in: .whitespaces) }
.filter { !$0.isEmpty }
guard configData.count == 2 else {
throw FestivalError.invalidConfiguration
}
let logFile = URL(fileURLWithPath: configData[0])
let listDirectory = URL(fileURLWithPath: configData[1])
let logPath = try String(contentsOf: configFile)
.trimmingCharacters(in: .whitespaces)
let logFile = URL(fileURLWithPath: logPath)
let listDirectory = URL(fileURLWithPath: app.directory.publicDirectory)
.appendingPathComponent("lists")
try Log.set(logFile: logFile.path)