Skip to content

Commit

Permalink
goreleaser: use defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 27, 2024
1 parent 3200c40 commit 90a2fd6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
13 changes: 1 addition & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
before:
hooks:
- go mod download
Expand All @@ -10,20 +11,8 @@ builds:
- darwin
main: ./cmd/carapace-shlex
binary: carapace-shlex
tags:
- release
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
3 changes: 2 additions & 1 deletion cmd/carapace-shlex/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ var rootCmd = &cobra.Command{
},
}

func Execute() error {
func Execute(version string) error {
rootCmd.Version = version
return rootCmd.Execute()
}

Expand Down
15 changes: 13 additions & 2 deletions cmd/carapace-shlex/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
package main

import "github.com/carapace-sh/carapace-shlex/cmd/carapace-shlex/cmd"
import (
"fmt"
"strings"

"github.com/carapace-sh/carapace-shlex/cmd/carapace-shlex/cmd"
)

var commit, date string
var version = "develop"

func main() {
cmd.Execute()
if strings.Contains(version, "SNAPSHOT") {
version += fmt.Sprintf(" (%v) [%v]", date, commit)
}
cmd.Execute(version)
}

0 comments on commit 90a2fd6

Please sign in to comment.