Skip to content

Commit

Permalink
chore: generate brew completions
Browse files Browse the repository at this point in the history
  • Loading branch information
adikari committed Oct 3, 2022
1 parent 84033c7 commit 4d64c90
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ go.work

safebox
dist/
completions/
10 changes: 10 additions & 0 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 test ./...
- ./scripts/completions.sh
builds:
- binary: safebox
env:
Expand All @@ -14,6 +15,10 @@ builds:
checksum:
name_template: 'checksums.txt'

archives:
- files:
- completions/*

snapshot:
name_template: "{{ incpatch .Version }}-next"

Expand All @@ -32,6 +37,11 @@ brews:
license: "MIT"
test: |
system "#{bin}/safebox --version"
install: |
bin.install "safebox"
bash_completion.install "completions/safebox.bash" => "safebox"
zsh_completion.install "completions/safebox.zsh" => "_safebox"
fish_completion.install "completions/safebox.fish"
tap:
owner: adikari
name: homebrew-taps
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
set -e
rm -rf completions
mkdir completions

for sh in bash zsh fish; do
go run main.go completion "$sh" >"completions/safebox.$sh"
done

0 comments on commit 4d64c90

Please sign in to comment.