Skip to content

Commit b4a6e95

Browse files
authored
Fix plugin templates (#6557)
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). (cherry picked from commit 78cceb7)
1 parent a78ab36 commit b4a6e95

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
@@ -287,15 +287,15 @@ public final class InitPackage {
287287
} else if packageType == .buildToolPlugin {
288288
param += """
289289
.plugin(
290-
name: "\(typeName)",
290+
name: "\(pkgname)",
291291
capability: .buildTool()
292292
),
293293
]
294294
"""
295295
} else if packageType == .commandPlugin {
296296
param += """
297297
.plugin(
298-
name: "\(typeName)",
298+
name: "\(pkgname)",
299299
capability: .command(intent: .custom(
300300
verb: "\(typeName)",
301301
description: "prints hello world"

0 commit comments

Comments
 (0)