From 43ca459080fa81d39144745837b6107131e2dd6e Mon Sep 17 00:00:00 2001 From: Gurkirat Singh Date: Sun, 10 Jan 2021 19:20:30 +0530 Subject: [PATCH] formatted brew completion --- completion/available/brew.completion.bash | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/completion/available/brew.completion.bash b/completion/available/brew.completion.bash index 4bdaf53d..0e8d72a9 100644 --- a/completion/available/brew.completion.bash +++ b/completion/available/brew.completion.bash @@ -4,8 +4,8 @@ # BASH_IT_LOAD_PRIORITY: 375 if [[ "$(uname -s)" != 'Darwin' ]] ; then - _log_warning "unsupported operating system - only 'Darwin' is supported" - return 0 + _log_warning "unsupported operating system - only 'Darwin' is supported" + return 1 fi # Make sure brew is installed @@ -13,15 +13,15 @@ _command_exists brew || return 0 BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)} -if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]] ; then - source "$BREW_PREFIX"/etc/bash_completion.d/brew +if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then + source "$BREW_PREFIX"/etc/bash_completion.d/brew -elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]] ; then - source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh + elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]] ; then + source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh -elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]] ; then - # For the git-clone based installation, see here for more info: - # https://github.com/Bash-it/bash-it/issues/1458 - # https://docs.brew.sh/Shell-Completion - source "$BREW_PREFIX"/completions/bash/brew + elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]] ; then + # For the git-clone based installation, see here for more info: + # https://github.com/Bash-it/bash-it/issues/1458 + # https://docs.brew.sh/Shell-Completion + source "$BREW_PREFIX"/completions/bash/brew fi