diff --git a/.gitignore b/.gitignore index 93e6f75..aae8eaf 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ env docker-compose.yml .idea/ +# Completions +/completions/ diff --git a/.goreleaser.yml b/.goreleaser.yml index 08d353e..dd986cb 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,6 +4,7 @@ project_name: sonar before: hooks: - go mod download + - make completions builds: - id: server @@ -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' diff --git a/Makefile b/Makefile index 9ef1d90..9202e93 100644 --- a/Makefile +++ b/Makefile @@ -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 #