8074eb8b46d20a2f3ad2b99201388900a2e33450

Author
Dennis Dashkevich <dskecse@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(chruby): update brew sourcing for Apple Silicon (#12941)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>

Diff

 1diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
 2index 1210897c4a5fc5acb43e72b2c36a13ba107106b7..06afef189a3ca47d29c590b81f06d40245dd26de 100644
 3--- a/plugins/chruby/chruby.plugin.zsh
 4+++ b/plugins/chruby/chruby.plugin.zsh
 5@@ -22,6 +22,8 @@ _source-from-homebrew() {
 6   # check default brew prefix
 7   if [[ -h /usr/local/opt/chruby ]];then
 8     _brew_prefix="/usr/local/opt/chruby"
 9+  elif [[ -h /opt/homebrew/opt/chruby ]]; then
10+    _brew_prefix="/opt/homebrew/opt/chruby"
11   else
12     # ok , it is not default prefix
13     # this call to brew is expensive ( about 400 ms ), so at least let's make it only once