Skip to content

Commit

Permalink
Clarifying variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
Full Queue Developer authored and Full Queue Developer committed Oct 15, 2023
1 parent 6a6cba5 commit 74a3bf5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Plugins/GenerateTemplatesPlugin/GenerateTemplatesPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ struct GenerateTemplatesPlugin: BuildToolPlugin {
func createBuildCommands(context: PackagePlugin.PluginContext, target: PackagePlugin.Target) async throws -> [PackagePlugin.Command] {

let templatesDir = context.package.directory.appending(subpath: "templates")

let contents = try FileManager.default.contentsOfDirectory(atPath: templatesDir.string)


let enumerator = FileManager.default.enumerator(atPath: templatesDir.string)



let inputFiles = paths(fromEnumerator: enumerator!).map { path in
templatesDir.appending(path)
}

let templateDirNames = try FileManager.default.contentsOfDirectory(atPath: templatesDir.string)

return [
.buildCommand(
displayName: "GenerateTemplatesPlugin",
Expand All @@ -28,7 +25,7 @@ struct GenerateTemplatesPlugin: BuildToolPlugin {
inputFiles: inputFiles,
outputFiles: [
context.pluginWorkDirectory.appending("Templates.swift"),
] + contents.map({ templateName in
] + templateDirNames.map({ templateName in
context.pluginWorkDirectory.appending("\(templateName)Template.swift")
})
),
Expand Down

0 comments on commit 74a3bf5

Please sign in to comment.