diff options
author | Carlo Sala <carlosalag@protonmail.com> | 2023-04-27 09:57:44 +0200 |
---|---|---|
committer | Carlo Sala <carlosalag@protonmail.com> | 2023-04-27 19:46:29 +0200 |
commit | 65699912be974d36b732b63e32c3b9428d23ace8 (patch) | |
tree | d27e3b55bc2424c415e61e11df4d1dac40207957 /plugins | |
parent | 343c78ae91ff03ea66517b1d69b25fa262ce5408 (diff) | |
download | zsh-65699912be974d36b732b63e32c3b9428d23ace8.tar.gz zsh-65699912be974d36b732b63e32c3b9428d23ace8.tar.bz2 zsh-65699912be974d36b732b63e32c3b9428d23ace8.zip |
fix(azure): recognize properly linuxbrew
Closes #11644
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/azure/azure.plugin.zsh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/azure/azure.plugin.zsh b/plugins/azure/azure.plugin.zsh index 8fec3c1f7..22fbea80f 100644 --- a/plugins/azure/azure.plugin.zsh +++ b/plugins/azure/azure.plugin.zsh @@ -31,11 +31,9 @@ function _az-homebrew-installed() { # check if Homebrew is installed (( $+commands[brew] )) || return 1 - # speculatively check default brew prefix - if [[ -d /usr/local ]]; then - _brew_prefix=/usr/local - elif [[ -d /opt/homebrew ]]; then - _brew_prefix=/opt/homebrew + # if so, we assume it's default way to install brew + if [[ ${commands[brew]:t2} == bin/brew ]]; then + _brew_prefix="${commands[brew]:h:h}" # remove trailing /bin/brew else # ok, it is not in the default prefix # this call to brew is expensive (about 400 ms), so at least let's make it only once |