From 67550dd12f637c5e6aad2b53be2192c8b28e6898 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 12 Feb 2025 20:23:53 +0100 Subject: [PATCH] add apple silicon brew --- plugins/chruby/chruby.plugin.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh index 0a1c0f7d1..06afef189 100644 --- a/plugins/chruby/chruby.plugin.zsh +++ b/plugins/chruby/chruby.plugin.zsh @@ -16,15 +16,16 @@ _source-from-omz-settings() { } _source-from-homebrew() { + (( $+commands[brew] )) || return 1 + local _brew_prefix # check default brew prefix - if [[ -h /opt/homebrew/opt/chruby ]]; then + if [[ -h /usr/local/opt/chruby ]];then + _brew_prefix="/usr/local/opt/chruby" + elif [[ -h /opt/homebrew/opt/chruby ]]; then _brew_prefix="/opt/homebrew/opt/chruby" else # ok , it is not default prefix - # check to see if brew command is available - (( $+commands[brew] )) || return 1 - # this call to brew is expensive ( about 400 ms ), so at least let's make it only once _brew_prefix=$(brew --prefix chruby) fi