Skip to content

Commit

Permalink
[command-not-found] Load brew 'command-not-found' if homebrew tap is …
Browse files Browse the repository at this point in the history
…available

Homebrew has _official_ tap that supports `command-not-found`.
Enable it when possible.
  • Loading branch information
indrajitr authored and belak committed Jul 13, 2017
1 parent 04bfb51 commit b0c85ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/command-not-found/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# Authors:
# Joseph Jon Booker <[email protected]>
# Indrajit Raychaudhuri <[email protected]>
#

# Load command-not-found on Debian-based distributions.
Expand All @@ -11,6 +12,9 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then
# 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'
# Load command-not-found on Mac OS X when homebrew tap is configured.
elif (( $+commands[brew] )) && brew command command-not-found-init > /dev/null 2>&1; then
eval "$(brew command-not-found-init)"
# Return if requirements are not found.
else
return 1
Expand Down

0 comments on commit b0c85ed

Please sign in to comment.