Generate files from Template.

This commit is contained in:
Marek Fořt 2020-02-16 17:18:25 +01:00
parent c9f1748900
commit 7560d3703d
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,9 @@ public class TemplateLoader: TemplateLoading {
to destinationPath: AbsolutePath) throws {
let template = try load(at: sourcePath)
try template.directories.map(destinationPath.appending).forEach(FileHandler.shared.createFolder)
try template.files.forEach { try FileHandler.shared.write($0.contents,
path: destinationPath.appending($0.path),
atomically: true) }
}
}