Skip to content

Commit

Permalink
Add pluralized name tags {names}, {Names}, {NAMES}
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed Feb 12, 2021
1 parent d443dd2 commit a38da5a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
"version": "1.0.1"
}
},
{
"package": "plural-kit",
"repositoryURL": "https://github.com/binarybirds/plural-kit.git",
"state": {
"branch": null,
"revision": "0bbac9a39a1a89187aebb8684420ca3f10036770",
"version": "1.0.0"
}
},
{
"package": "shell-kit",
"repositoryURL": "https://github.com/binarybirds/shell-kit",
Expand Down
2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let package = Package(
.package(url: "https://github.com/binarybirds/shell-kit", from: "1.0.0"),
.package(url: "https://github.com/binarybirds/git-kit", from: "1.0.0"),
.package(url: "https://github.com/binarybirds/build-kit", from: "1.0.0"),
.package(url: "https://github.com/binarybirds/plural-kit.git", from: "1.0.0"),
],
targets: [
.target(name: "SwiftTemplateCli", dependencies: [
Expand All @@ -27,6 +28,7 @@ let package = Package(
.product(name: "ShellKit", package: "shell-kit"),
.product(name: "GitKit", package: "git-kit"),
.product(name: "BuildKit", package: "build-kit"),
.product(name: "PluralKit", package: "plural-kit"),
]),
.testTarget(name: "SwiftTemplateTests", dependencies: ["SwiftTemplate"]),
]
Expand Down
5 changes: 5 additions & 0 deletions Sources/SwiftTemplate/Template.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation
import GitKit
import PathKit
import PluralKit

public struct Template {

Expand Down Expand Up @@ -54,6 +55,10 @@ public struct Template {
"Name": context.name.capitalizedFirstCharacter,
"NAME": context.name.uppercased(),

"names": context.name.pluralized(),
"Names": context.name.pluralized().capitalizedFirstCharacter,
"NAMES": context.name.pluralized().uppercased(),

"project": context.project,
"author": context.author,
"date": dateFormatter.string(from: context.date)
Expand Down

0 comments on commit a38da5a

Please sign in to comment.