Skip to content

Commit

Permalink
chore(cli): Change version format to use short commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Aug 30, 2023
1 parent 68caaf4 commit b95eeac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ builds:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s
- -w
- -X main.version=v{{.Version}}
- -X main.commit={{.ShortCommit}}
- -X main.date={{.Date}}
- -X main.builtBy=goreleaser
goarch:
- amd64
- arm
Expand Down
3 changes: 2 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func NewCommand(version, commit string) *cobra.Command {
},
DisableAutoGenTag: true,
}
cmd.SetVersionTemplate("CastSponsorSkip {{ .Version }}\n")

CompletionFlag(cmd)
config.Default.RegisterFlags(cmd)
Expand Down Expand Up @@ -77,7 +78,7 @@ func run(cmd *cobra.Command, args []string) (err error) {
return completion(cmd)
}

slog.Info("CastSponsorSkip version " + cmd.Version)
slog.Info("CastSponsorSkip " + cmd.Version)

ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT)
defer cancel()
Expand Down

0 comments on commit b95eeac

Please sign in to comment.