2012-01-31 23:37:51 -05:00
|
|
|
#
|
|
|
|
# Displays installation information for not found commands.
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Joseph Jon Booker <joe@neoturbine.net>
|
2016-08-04 15:57:16 -05:00
|
|
|
# Indrajit Raychaudhuri <irc+code@indrajit.com>
|
2012-01-31 23:37:51 -05:00
|
|
|
#
|
2011-08-30 23:16:15 -04:00
|
|
|
|
2013-10-01 16:06:57 +02:00
|
|
|
# Load command-not-found on Debian-based distributions.
|
|
|
|
if [[ -s '/etc/zsh_command_not_found' ]]; then
|
|
|
|
source '/etc/zsh_command_not_found'
|
|
|
|
# Load command-not-found on Arch Linux-based distributions.
|
|
|
|
elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
|
|
|
|
source '/usr/share/doc/pkgfile/command-not-found.zsh'
|
2018-07-31 20:29:01 -05:00
|
|
|
# Load command-not-found on macOS when Homebrew tap is configured.
|
2021-04-29 20:18:22 -05:00
|
|
|
elif (( $+commands[brew] )) \
|
|
|
|
&& [[ -s "${hb_cnf_handler::="$(brew --repository 2> /dev/null)"/Library/Taps/homebrew/homebrew-command-not-found/handler.sh}" ]]; then
|
|
|
|
source "$hb_cnf_handler"
|
|
|
|
unset hb_cnf_handler
|
2012-07-23 15:00:44 -04:00
|
|
|
# Return if requirements are not found.
|
2013-10-01 16:06:57 +02:00
|
|
|
else
|
2012-07-23 15:00:44 -04:00
|
|
|
return 1
|
2011-08-30 23:16:15 -04:00
|
|
|
fi
|