Skip to content

Commit ba4b67e

Browse files
koki-developclaude
andauthored
fix: Add shell completion installation to Homebrew formula (#204)
Co-authored-by: Claude <[email protected]>
1 parent 648dd4f commit ba4b67e

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/gat
22
/dist/
3+
/completions/

.goreleaser.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: 2
33
before:
44
hooks:
55
- go mod tidy
6+
- ./scripts/build-completions.sh
67
builds:
78
- ldflags:
89
- -s -w -X github.com/koki-develop/gat/cmd.version=v{{.Version}}
@@ -15,6 +16,8 @@ builds:
1516

1617
archives:
1718
- formats: [tar.gz]
19+
files:
20+
- completions/*
1821
name_template: >-
1922
{{ .ProjectName }}_
2023
{{- title .Os }}_
@@ -40,3 +43,8 @@ brews:
4043
name: homebrew-tap
4144
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
4245
directory: Formula
46+
install: |
47+
bin.install "gat"
48+
bash_completion.install "completions/gat.bash" => "gat"
49+
zsh_completion.install "completions/gat.zsh" => "_gat"
50+
fish_completion.install "completions/gat.fish"

scripts/build-completions.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
rm -rf completions
6+
mkdir completions
7+
8+
go build .
9+
10+
./gat completion bash > completions/gat.bash
11+
./gat completion zsh > completions/gat.zsh
12+
./gat completion fish > completions/gat.fish

0 commit comments

Comments
 (0)