Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
8a008e1f
Unverified
Commit
8a008e1f
authored
Feb 23, 2023
by
Carlo Sala
Committed by
GitHub
Feb 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(azure): load completion properly for brew (#11499)
Closes #11497
parent
b54ef89f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
azure.plugin.zsh
plugins/azure/azure.plugin.zsh
+7
-5
No files found.
plugins/azure/azure.plugin.zsh
View file @
8a008e1f
...
@@ -32,12 +32,14 @@ function _az-homebrew-installed() {
...
@@ -32,12 +32,14 @@ function _az-homebrew-installed() {
((
$+
commands[brew]
))
||
return
1
((
$+
commands[brew]
))
||
return
1
# speculatively check default brew prefix
# speculatively check default brew prefix
if
[
-h
/usr/local/opt/az
]
;
then
if
[[
-d
/usr/local
]]
;
then
_brew_prefix
=
/usr/local/opt/az
_brew_prefix
=
/usr/local
elif
[[
-d
/opt/homebrew
]]
;
then
_brew_prefix
=
/opt/homebrew
else
else
# ok, it is not in the default prefix
# 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
# this call to brew is expensive (about 400 ms), so at least let's make it only once
_brew_prefix
=
$(
brew
--prefix
azure-cli
)
_brew_prefix
=
$(
brew
--prefix
)
fi
fi
}
}
...
@@ -49,12 +51,12 @@ _az_zsh_completer_path="$commands[az_zsh_completer.sh]"
...
@@ -49,12 +51,12 @@ _az_zsh_completer_path="$commands[az_zsh_completer.sh]"
if
[[
-z
$_az_zsh_completer_path
]]
;
then
if
[[
-z
$_az_zsh_completer_path
]]
;
then
# Homebrew
# Homebrew
if
_az-homebrew-installed
;
then
if
_az-homebrew-installed
;
then
_az_zsh_completer_path
=
$_brew_prefix
/
libexec/bin/az.completion.sh
_az_zsh_completer_path
=
$_brew_prefix
/
etc/bash_completion.d/az
# Linux
# Linux
else
else
_az_zsh_completer_path
=
/etc/bash_completion.d/azure-cli
_az_zsh_completer_path
=
/etc/bash_completion.d/azure-cli
fi
fi
fi
fi
[[
-r
$_az_zsh_completer_path
]]
&&
source
$_az_zsh_completer_path
[[
-r
$_az_zsh_completer_path
]]
&&
autoload
-U
+X bashcompinit
&&
bashcompinit
&&
source
$_az_zsh_completer_path
unset
_az_zsh_completer_path _brew_prefix
unset
_az_zsh_completer_path _brew_prefix
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment