Skip to content

Commit 87a4ec6

Browse files
committed
fixing goreleaser and version number
1 parent 1181416 commit 87a4ec6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ builds:
1010
- env:
1111
- CGO_ENABLED=0
1212
ldflags:
13-
- -s -w -X main.build={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
13+
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
1414
archive:
1515
replacements:
1616
darwin: Darwin

cmd/root.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ command line.`,
3737
RunE: func(cmd *cobra.Command, args []string) error {
3838
printVersion, _ := cmd.Flags().GetBool("version")
3939
if printVersion {
40+
if len(Version) > 0 && Version[0] != 'v' && Version != "dev" {
41+
Version = "v" + Version
42+
}
4043
fmt.Printf("go-chromecast %s (%s) %s\n", Version, Commit, Date)
4144
return nil
4245
}

0 commit comments

Comments
 (0)