Merge pull request #1808 from NoahGorny/cleanup/brew-completions
formatted brew completionpull/1809/head
commit
ef110e167c
|
|
@ -57,6 +57,7 @@ plugins/available/xterm.plugin.bash
|
||||||
|
|
||||||
# completions
|
# completions
|
||||||
#
|
#
|
||||||
|
completion/available/brew.completion.bash
|
||||||
completion/available/cargo.completion.bash
|
completion/available/cargo.completion.bash
|
||||||
completion/available/knife.completion.bash
|
completion/available/knife.completion.bash
|
||||||
completion/available/packer.completion.bash
|
completion/available/packer.completion.bash
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
# shellcheck shell=bash
|
||||||
|
cite "about-completion"
|
||||||
|
about-completion "brew completion"
|
||||||
|
|
||||||
# Load late to make sure `system` completion loads first
|
# Load late to make sure `system` completion loads first
|
||||||
# BASH_IT_LOAD_PRIORITY: 375
|
# BASH_IT_LOAD_PRIORITY: 375
|
||||||
|
|
||||||
if [[ "$(uname -s)" != 'Darwin' ]] ; then
|
if [[ "$(uname -s)" != 'Darwin' ]]; then
|
||||||
_log_warning "unsupported operating system - only 'Darwin' is supported"
|
_log_warning "unsupported operating system - only 'Darwin' is supported"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure brew is installed
|
# Make sure brew is installed
|
||||||
|
|
@ -13,15 +15,18 @@ _command_exists brew || return 0
|
||||||
|
|
||||||
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
|
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
|
||||||
|
|
||||||
if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]] ; then
|
if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then
|
||||||
source "$BREW_PREFIX"/etc/bash_completion.d/brew
|
# shellcheck disable=1090
|
||||||
|
source "$BREW_PREFIX"/etc/bash_completion.d/brew
|
||||||
|
|
||||||
elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]] ; then
|
elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]]; then
|
||||||
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh
|
# shellcheck disable=1090
|
||||||
|
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh
|
||||||
|
|
||||||
elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]] ; then
|
elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]]; then
|
||||||
# For the git-clone based installation, see here for more info:
|
# For the git-clone based installation, see here for more info:
|
||||||
# https://github.com/Bash-it/bash-it/issues/1458
|
# https://github.com/Bash-it/bash-it/issues/1458
|
||||||
# https://docs.brew.sh/Shell-Completion
|
# https://docs.brew.sh/Shell-Completion
|
||||||
source "$BREW_PREFIX"/completions/bash/brew
|
# shellcheck disable=1090
|
||||||
|
source "$BREW_PREFIX"/completions/bash/brew
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue