summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wang <wangyang0123@gmail.com>2021-04-08 13:59:57 +0800
committerMarc Cornellà <hello@mcornella.com>2021-04-09 21:22:24 +0200
commit8b55fb3b60e885934745b03d8fd550c6eaa82121 (patch)
treec44fec83c0c3e3395106fb909f0a99993191efd1 /plugins
parent9f8801bea6120817bc4f03f9d80dc1230ea7b2b0 (diff)
downloadzsh-8b55fb3b60e885934745b03d8fd550c6eaa82121.tar.gz
zsh-8b55fb3b60e885934745b03d8fd550c6eaa82121.tar.bz2
zsh-8b55fb3b60e885934745b03d8fd550c6eaa82121.zip
feat(command-not-found): add support for Homebrew on Apple M1 (#9797)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/command-not-found/command-not-found.plugin.zsh9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
index aea1e1b4c..10f3a6277 100644
--- a/plugins/command-not-found/command-not-found.plugin.zsh
+++ b/plugins/command-not-found/command-not-found.plugin.zsh
@@ -38,10 +38,13 @@ if [ -f /usr/libexec/pk-command-not-found ]; then
}
fi
-# OSX command-not-found support
+# macOS command-not-found support
# https://github.com/Homebrew/homebrew-command-not-found
-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'
+HB_CNF_HANDLER_SUFFIX="Library/Taps/homebrew/homebrew-command-not-found/handler.sh"
+if [[ -s "/opt/homebrew/$HB_CNF_HANDLER_SUFFIX" ]]; then
+ source "/opt/homebrew/$HB_CNF_HANDLER_SUFFIX"
+elif [[ -s "/usr/local/Homebrew/$HB_CNF_HANDLER_SUFFIX" ]]; then
+ source "/usr/local/Homebrew/$HB_CNF_HANDLER_SUFFIX"
fi
# NixOS command-not-found support