From 0182cff2f481e6d93c3afd44a5f23ef31115bb78 Mon Sep 17 00:00:00 2001 From: Anton Prokhorov Date: Tue, 16 Jul 2024 22:47:21 +0100 Subject: [PATCH] Automatic completions install with brew --- .gitignore | 2 ++ .goreleaser.yml | 4 ++++ Makefile | 12 ++++++++++++ 3 files changed, 18 insertions(+) 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 #