Skip to content

Commit c9c6477

Browse files
Hide commit/built fields when not available from module install
1 parent b9b7cdc commit c9c6477

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

internal/cli/root.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@ var versionCmd = &cobra.Command{
6767
Short: "Print version information",
6868
Run: func(cmd *cobra.Command, args []string) {
6969
fmt.Printf("cryptoscan %s\n", version)
70-
fmt.Printf(" commit: %s\n", commit)
71-
fmt.Printf(" built: %s\n", buildDate)
70+
if commit != "none" {
71+
fmt.Printf(" commit: %s\n", commit)
72+
}
73+
if buildDate != "unknown" {
74+
fmt.Printf(" built: %s\n", buildDate)
75+
}
7276
fmt.Printf("\nPart of QRAMM - https://qramm.org\n")
7377
fmt.Printf("Copyright 2025 CSNP - https://csnp.org\n")
7478
},

0 commit comments

Comments
 (0)