From e906a3130eb5031a2c82d9187ea17387881631db Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 8 Apr 2023 11:13:30 +0200 Subject: fix(azure): look properly for azure config file Closes #11606 --- plugins/azure/azure.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/azure/azure.plugin.zsh') diff --git a/plugins/azure/azure.plugin.zsh b/plugins/azure/azure.plugin.zsh index 51b54dbc1..8fec3c1f7 100644 --- a/plugins/azure/azure.plugin.zsh +++ b/plugins/azure/azure.plugin.zsh @@ -18,10 +18,10 @@ compctl -K _az_subscriptions azss # Azure prompt function azure_prompt_info() { - [[ ! -f "${AZURE_CONFIG_DIR:-$HOME/.azure/azureProfile.json}" ]] && return + [[ ! -f "${AZURE_CONFIG_DIR:-$HOME/.azure}/azureProfile.json" ]] && return # azgs is too expensive, if we have jq, we enable the prompt (( $+commands[jq] )) || return 1 - azgs=$(jq -r '.subscriptions[] | select(.isDefault==true) .name' ${AZURE_CONFIG_DIR:-$HOME/.azure/azureProfile.json}) + azgs=$(jq -r '.subscriptions[] | select(.isDefault==true) .name' "${AZURE_CONFIG_DIR:-$HOME/.azure}/azureProfile.json") echo "${ZSH_THEME_AZURE_PREFIX:=}" } -- cgit v1.2.3-70-g09d2 From 65699912be974d36b732b63e32c3b9428d23ace8 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 27 Apr 2023 09:57:44 +0200 Subject: fix(azure): recognize properly linuxbrew Closes #11644 --- plugins/azure/azure.plugin.zsh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/azure/azure.plugin.zsh') 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 -- cgit v1.2.3-70-g09d2 From 5fc1118fd240a0d87ad022d36f48cb31d869ab2e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 27 Apr 2023 19:42:55 +0200 Subject: chore(azure): fix typo --- plugins/azure/azure.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/azure/azure.plugin.zsh') diff --git a/plugins/azure/azure.plugin.zsh b/plugins/azure/azure.plugin.zsh index 22fbea80f..b33b0f805 100644 --- a/plugins/azure/azure.plugin.zsh +++ b/plugins/azure/azure.plugin.zsh @@ -1,4 +1,4 @@ -# AZ Get Subscritions +# AZ Get Subscriptions function azgs() { az account show --output tsv --query 'name' 2>/dev/null } -- cgit v1.2.3-70-g09d2