Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: brew completion #161

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ release:
replace_existing_draft: true

archives:
- format_overrides:
- files:
- LICENSE
- README.md
- completions/*
format_overrides:
- goos: windows
format: zip

Expand Down Expand Up @@ -66,13 +70,10 @@ brews:
description: "Interact with Nine API resources."
license: "Apache 2.0"

post_install: |
File.write "nctl.bash", system("nctl", "completions", "-c", "bash")
File.write "nctl.zsh", system("nctl", "completions", "-c", "zsh")
File.write "nctl.fish", system("nctl", "completions", "-c", "fish")
bash_completion.install "nctl.bash"
zsh_completion.install "nctl.zsh"
fish_completion.install "nctl.fish"
extra_install: |
bash_completion.install "completions/nctl.bash" => "nctl"
zsh_completion.install "completions/nctl.zsh" => "_nctl"
fish_completion.install "completions/nctl.fish"

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist folder only,
Expand Down
1 change: 1 addition & 0 deletions completions/nctl.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
complete -o default -o bashdefault -C nctl nctl
7 changes: 7 additions & 0 deletions completions/nctl.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function __complete_nctl
set -lx COMP_LINE (commandline -cp)
test -z (commandline -ct)
and set COMP_LINE "$COMP_LINE "
nctl
end
complete -f -c nctl -a "(__complete_nctl)"
2 changes: 2 additions & 0 deletions completions/nctl.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
autoload -U +X bashcompinit && bashcompinit
complete -o default -o bashdefault -C nctl nctl