Skip to content

Commit de1c3ba

Browse files
authored
[Collections] describe subcommand should include signature info (#3315)
Motivation: `package-collection`'s `describe` subcommand should display signature info if collection is signed. Modifications: Update output for signed collection to print additional: ``` Signed By: Jane Doe (verified) ```
1 parent 426295a commit de1c3ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Commands/SwiftPackageCollectionsTool.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,13 @@ public struct SwiftPackageCollectionsTool: ParsableCommand {
323323
if jsonOptions.json {
324324
try JSONEncoder.makeWithDefaults().print(collection)
325325
} else {
326+
let signature = optionalRow("Signed By", collection.signature.map { "\($0.certificate.subject.commonName ?? "Unspecified") (\($0.isVerified ? "" : "not ")verified)" })
327+
326328
print("""
327329
Name: \(collection.name)
328330
Source: \(collection.source.url)\(description)\(keywords)\(createdAt)
329331
Packages:
330-
\(packages)
332+
\(packages)\(signature)
331333
""")
332334
}
333335
} catch {

0 commit comments

Comments
 (0)