oh-my-bash/completions/system.completion.sh
M 4fb778c405 Refactor "{{which,command -v} => _omb_util_{binary,command}_exists}"
`which` has been deprecated in Debian (at least, the rolling release
installed on chromebooks via Linux Containers)

https://github.com/ohmybash/oh-my-bash/pull/239#issuecomment-1000974461

Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
2022-08-23 18:09:16 +09:00

28 lines
823 B
Bash

#! bash oh-my-bash.module
# Loads the system's Bash completion modules.
# If Homebrew is installed (OS X), its Bash completion modules are loaded.
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
# Some distribution makes use of a profile.d script to import completion.
if [ -f /etc/profile.d/bash_completion.sh ]; then
. /etc/profile.d/bash_completion.sh
fi
if [ $(uname) = "Darwin" ] && _omb_util_command_exists brew; then
BREW_PREFIX=$(brew --prefix)
if [ -f "$BREW_PREFIX"/etc/bash_completion ]; then
. "$BREW_PREFIX"/etc/bash_completion
fi
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
if [ -f "$BREW_PREFIX"/share/bash-completion/bash_completion ]; then
. "$BREW_PREFIX"/share/bash-completion/bash_completion
fi
fi