Merge pull request #1908 from gaelicWizard/bash_completion
Import bash-completion slightly more carefullypull/1913/head
commit
0fb9d0c090
|
|
@ -1,9 +1,11 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
# Loads the system's Bash completion modules.
|
# Loads the system's Bash completion modules.
|
||||||
# If Homebrew is installed (OS X), it's Bash completion modules are loaded.
|
# If Homebrew is installed (OS X), it's Bash completion modules are loaded.
|
||||||
|
|
||||||
if [[ -r /etc/bash_completion ]] ; then
|
if [[ -r "${BASH_COMPLETION:-}" ]] ; then
|
||||||
|
source "${BASH_COMPLETION}"
|
||||||
|
elif [[ -r /etc/bash_completion ]] ; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source /etc/bash_completion
|
source /etc/bash_completion
|
||||||
|
|
||||||
|
|
@ -12,14 +14,12 @@ elif [[ -r /etc/profile.d/bash_completion.sh ]] ; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source /etc/profile.d/bash_completion.sh
|
source /etc/profile.d/bash_completion.sh
|
||||||
|
|
||||||
fi
|
elif [[ $OSTYPE == 'darwin'* ]] && _command_exists brew ; then
|
||||||
|
|
||||||
if [[ "$(uname -s)" == 'Darwin' ]] && _command_exists brew ; then
|
|
||||||
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
|
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
|
||||||
|
|
||||||
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
|
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
|
||||||
if [[ -r "$BREW_PREFIX"/etc/profile.d/bash_completion.sh ]] ; then
|
if [[ -r "$BREW_PREFIX"/etc/bash_completion ]] ; then
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$BREW_PREFIX"/etc/profile.d/bash_completion.sh
|
source "$BREW_PREFIX"/etc/bash_completion
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue