Skip to content

Commit

Permalink
install completions during homebrew install
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondřej Benkovský committed Jun 13, 2023
1 parent 0a4712e commit d6565bc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ graphs*/
# Jekyll documentation
_site
.jekyll-cache
completions
13 changes: 11 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ before:
hooks:
- go mod tidy
- go generate ./...
- sh scripts/completions.sh
builds:
- env:
- CGO_ENABLED=0
Expand All @@ -12,14 +13,18 @@ builds:
ldflags:
- -X 'github.com/tantalor93/dnspyre/v2/cmd.Version={{.Version}}-{{ .Os }}-{{ .Arch }}'
archives:
- id: foo
- id: dnspyre
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
files:
- LICENSE
- README.md
- completions/*
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -31,7 +36,11 @@ brews:
owner: tantalor93
name: homebrew-dnspyre
folder: Formula
homepage: https://github.com/Tantalor93/dnspyre
homepage: https://tantalor93.github.io/dnspyre/
install: |-
bin.install "dnspyre"
bash_completion.install "completions/dnspyre.bash" => "_dnspyre"
zsh_completion.install "completions/dnspyre.zsh" => "_dnspyre"
dockers:
- use: buildx
id: dnspyre
Expand Down
8 changes: 8 additions & 0 deletions scripts/completions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
# scripts/completions.sh
set -e
rm -rf completions
mkdir completions
for sh in bash zsh; do
go run main.go completion "$sh" >"completions/dnspyre.$sh"
done

0 comments on commit d6565bc

Please sign in to comment.