Skip to content

Commit 78cceb7

Browse files
authored
Fix plugin templates (#6517)
We are using `pkgname` everywhere as target names and also as dependency references, but plugin targets were using `typeName` which leads to newly created plugin packages being broken if the difference was meaningful (e.g. if the name includes dashes).
1 parent 8b876aa commit 78cceb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Workspace/InitPackage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ public final class InitPackage {
294294
} else if packageType == .buildToolPlugin {
295295
param += """
296296
.plugin(
297-
name: "\(typeName)",
297+
name: "\(pkgname)",
298298
capability: .buildTool()
299299
),
300300
]
301301
"""
302302
} else if packageType == .commandPlugin {
303303
param += """
304304
.plugin(
305-
name: "\(typeName)",
305+
name: "\(pkgname)",
306306
capability: .command(intent: .custom(
307307
verb: "\(typeName)",
308308
description: "prints hello world"

0 commit comments

Comments
 (0)