Skip to content

Commit c274e8e

Browse files
Install shell completions (#90)
1 parent 6e0d726 commit c274e8e

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ config.yaml
4949

5050
# Build artifacts
5151
latest.txt
52+
completions/
5253

5354
# Claude
54-
/.claude/*.local.*
55+
/.claude/*.local.*

.goreleaser.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ version: 2
44

55
project_name: tiger-cli
66

7-
# Create VERSION file before building
7+
# Create VERSION file and generate completions before building
88
before:
99
hooks:
1010
- sh -c 'echo "{{ .Tag }}" > latest.txt'
11+
- ./scripts/completions.sh
1112

1213
builds:
1314
- main: ./cmd/tiger
@@ -50,6 +51,7 @@ archives:
5051
- README.md
5152
- LICENSE
5253
- NOTICE
54+
- completions/*
5355

5456
# Linux package configuration (APT, RPM, etc.)
5557
nfpms:
@@ -68,6 +70,23 @@ nfpms:
6870
bindir: /usr/bin
6971
priority: extra
7072
file_name_template: "{{ .ConventionalFileName }}"
73+
contents:
74+
# Shell completions
75+
- src: ./completions/tiger.bash
76+
dst: /usr/share/bash-completion/completions/tiger
77+
file_info:
78+
mode: 0644
79+
mtime: "{{ .CommitDate }}"
80+
- src: ./completions/tiger.fish
81+
dst: /usr/share/fish/vendor_completions.d/tiger.fish
82+
file_info:
83+
mode: 0644
84+
mtime: "{{ .CommitDate }}"
85+
- src: ./completions/tiger.zsh
86+
dst: /usr/share/zsh/vendor-completions/_tiger
87+
file_info:
88+
mode: 0644
89+
mtime: "{{ .CommitDate }}"
7190
rpm:
7291
group: Unspecified
7392
deb:
@@ -102,7 +121,6 @@ blobs:
102121
# Homebrew cask configuration
103122
homebrew_casks:
104123
- name: tiger-cli
105-
106124
repository:
107125
owner: timescale
108126
name: homebrew-tap
@@ -124,6 +142,11 @@ homebrew_casks:
124142
if OS.mac?
125143
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/tiger"]
126144
end
145+
# Shell completions
146+
completions:
147+
bash: "completions/tiger.bash"
148+
zsh: "completions/tiger.zsh"
149+
fish: "completions/tiger.fish"
127150
# Optional: Add caveats for user instructions
128151
caveats: |
129152
Tiger CLI has been installed successfully!

scripts/completions.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
set -e
3+
rm -rf completions
4+
mkdir completions
5+
for sh in bash zsh fish; do
6+
go run ./cmd/tiger completion "$sh" >"completions/tiger.$sh"
7+
done

0 commit comments

Comments
 (0)