From 582ea5c2604fc535a37916d4182b0be739625a28 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Tue, 28 Apr 2020 17:14:15 -0500 Subject: [PATCH] Update based on @nwinkler's feedback --- completion/available/github-cli.completion.bash | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/completion/available/github-cli.completion.bash b/completion/available/github-cli.completion.bash index 761824d9..b3d1c1db 100644 --- a/completion/available/github-cli.completion.bash +++ b/completion/available/github-cli.completion.bash @@ -2,15 +2,9 @@ cite "about-completion" about-completion "GitHub CLI completion" -if command -v which gh >/dev/null 2>&1; then - if command -v which brew >/dev/null 2>&1; then - BREW_PREFIX=$(brew --prefix) - - if [ -f "$BREW_PREFIX"/etc/bash_completion.d/gh.sh ]; then - . "$BREW_PREFIX"/etc/bash_completion.d/gh.sh - fi - - else - eval "$(gh completion --shell=bash)" +if _command_exists gh; then + if _command_exists brew; then + echo "You don't need github-cli completion enabled if you have system completion enabled" fi + eval "$(gh completion --shell=bash)" fi