4b9bc91ce49ecf986b59aa181b2b0ba3e21c547b

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Merge pull request #4537 from agireud/command-not-found-OSX

Add OSX support for command-not-found

Diff

 1diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
 2index 797554a13e3501787763a03d79e019d93f0261d9..0e2f2133f15dca6291e7ef7c6cf98370732cd534 100644
 3--- a/plugins/command-not-found/command-not-found.plugin.zsh
 4+++ b/plugins/command-not-found/command-not-found.plugin.zsh
 5@@ -23,3 +23,11 @@ if [ -f /usr/libexec/pk-command-not-found ]; then
 6         return $retval
 7     }
 8 fi
 9+
10+# OSX command-not-found support
11+# https://github.com/Homebrew/homebrew-command-not-found
12+if type brew &> /dev/null; then
13+  if brew command command-not-found-init > /dev/null 2>&1; then
14+    eval "$(brew command-not-found-init)";
15+  fi
16+fi