Skip to content

Commit

Permalink
Automatic completions install with brew
Browse files Browse the repository at this point in the history
  • Loading branch information
nt0xa committed Jul 16, 2024
1 parent c780dea commit 0182cff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ env
docker-compose.yml
.idea/

# Completions
/completions/
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project_name: sonar
before:
hooks:
- go mod download
- make completions

builds:
- id: server
Expand Down Expand Up @@ -58,6 +59,9 @@ brews:

install: |
bin.install "sonar"
bash_completion.install "completions/sonar.bash" => "sonar"
zsh_completion.install "completions/sonar.zsh" => "_sonar"
fish_completion.install "completions/sonar.fish" => "sonar.fish"
checksum:
name_template: 'checksums.txt'
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ build/client:
dev:
@$(LOCAL_BIN)/air

#
# Completions
#

.PHONY: completions
completions: build/client
@rm -rf completions
@mkdir completions
@./sonar completion zsh > completions/sonar.zsh
@./sonar completion bash > completions/sonar.bash
@./sonar completion fish > completions/sonar.fish

#
# Tools
#
Expand Down

0 comments on commit 0182cff

Please sign in to comment.