From f910be9a3ce0efd0fadf5c0c69ff9abcddc4bcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20B=C3=B6decs?= Date: Fri, 12 Feb 2021 11:54:47 +0100 Subject: [PATCH] Cap first letter output dir --- Sources/SwiftTemplate/Template.swift | 2 +- Tests/SwiftTemplateTests/SwiftTemplateTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftTemplate/Template.swift b/Sources/SwiftTemplate/Template.swift index 0057a7c..00f8672 100644 --- a/Sources/SwiftTemplate/Template.swift +++ b/Sources/SwiftTemplate/Template.swift @@ -99,7 +99,7 @@ public struct Template { public func generate(output: String) throws { let inputPath = Path(input) - let outputPath = try Path(output).add(context.name) + let outputPath = try Path(output).add(context.name.capitalizedFirstCharacter) let ignorePath = inputPath.child(Template.ignoreFile) let ignoreFile = (try? String(contentsOf: ignorePath.url)) ?? "" let ignore = ignoreFile.split(separator: "\n").map(String.init).filter { !$0.isEmpty } diff --git a/Tests/SwiftTemplateTests/SwiftTemplateTests.swift b/Tests/SwiftTemplateTests/SwiftTemplateTests.swift index e8cbd53..08a6a95 100644 --- a/Tests/SwiftTemplateTests/SwiftTemplateTests.swift +++ b/Tests/SwiftTemplateTests/SwiftTemplateTests.swift @@ -36,7 +36,7 @@ final class SwiftTemplateTests: XCTestCase { let outputPath = Path(output) /// check if template was created - XCTAssertEqual(outputPath.children().map(\.name), ["test"]) + XCTAssertEqual(outputPath.children().map(\.name), ["Test"]) /// check if test directory was created inside the result project with the right name let resultPath = outputPath.child("test")