completion: Lint github-cli completion and use completion_exists
This commit is contained in:
@@ -64,6 +64,7 @@ completion/available/conda.completion.bash
|
||||
completion/available/consul.completion.bash
|
||||
completion/available/docker.completion.bash
|
||||
completion/available/gcloud.completion.bash
|
||||
completion/available/github-cli.completion.bash
|
||||
completion/available/helm.completion.bash
|
||||
completion/available/knife.completion.bash
|
||||
completion/available/packer.completion.bash
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "GitHub CLI completion"
|
||||
|
||||
if _binary_exists gh; then
|
||||
complete -p gh &> /dev/null || return
|
||||
# If gh already completed, stop
|
||||
_completion_exists gh && return
|
||||
eval "$(gh completion --shell=bash)"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user