diff options
author | Hielke Walinga <hielkewalinga@gmail.com> | 2020-03-02 13:34:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 13:34:26 +0100 |
commit | ed94e06dda36d2e321e11001b4d0f6db940e9ee9 (patch) | |
tree | abdf5f5d75299a9000227e9452218334bfc45334 | |
parent | e65bce849580fbb96c436b1a2a3739cb8c27c299 (diff) | |
download | zsh-ed94e06dda36d2e321e11001b4d0f6db940e9ee9.tar.gz zsh-ed94e06dda36d2e321e11001b4d0f6db940e9ee9.tar.bz2 zsh-ed94e06dda36d2e321e11001b4d0f6db940e9ee9.zip |
command-not-found: speed up call to Homebrew command-not-found (#7740)
By sourcing brew files directly we can achieve a very high speed up.
This will not work if the user installed homebrew in a different
location than by default.
-rw-r--r-- | plugins/command-not-found/command-not-found.plugin.zsh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index dd1186e44..81d76e638 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -26,10 +26,8 @@ fi # OSX command-not-found support # https://github.com/Homebrew/homebrew-command-not-found -if type brew &> /dev/null; then - if brew command command-not-found-init > /dev/null 2>&1; then - eval "$(brew command-not-found-init)"; - fi +if [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then + source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' fi # NixOS command-not-found support |