summaryrefslogtreecommitdiff
path: root/plugins/aws/aws.plugin.zsh
diff options
context:
space:
mode:
authordorons <doron.segev@gmail.com>2019-04-29 12:42:36 +0300
committerMarc Cornellà <marc.cornella@live.com>2019-04-29 11:42:36 +0200
commitd16adb6a9f9b0ea46121f48751a012f0511b465b (patch)
tree3fac7747300c1547ced9dd41a195fe6bb67345d4 /plugins/aws/aws.plugin.zsh
parentf5b2d9c7ce8ced5a4ec67a4ecfa877e6951124ef (diff)
downloadzsh-d16adb6a9f9b0ea46121f48751a012f0511b465b.tar.gz
zsh-d16adb6a9f9b0ea46121f48751a012f0511b465b.tar.bz2
zsh-d16adb6a9f9b0ea46121f48751a012f0511b465b.zip
aws: fix path resolution of aws completion for Ubuntu (#7812)
Diffstat (limited to 'plugins/aws/aws.plugin.zsh')
-rw-r--r--plugins/aws/aws.plugin.zsh17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 0895cfb3a..4bec30490 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -67,11 +67,18 @@ _awscli-homebrew-installed() {
# get aws_zsh_completer.sh location from $PATH
_aws_zsh_completer_path="$commands[aws_zsh_completer.sh]"
-# otherwise check if installed via Homebrew
-if [[ -z $_aws_zsh_completer_path ]] && _awscli-homebrew-installed; then
- _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
-else
- _aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh
+# otherwise check common locations
+if [[ -z $_aws_zsh_completer_path ]]; then
+ # Homebrew
+ if _awscli-homebrew-installed; then
+ _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
+ # Ubuntu
+ elif [[ -e /usr/share/zsh/vendor-completions/_awscli ]]; then
+ _aws_zsh_completer_path=/usr/share/zsh/vendor-completions/_awscli
+ # RPM
+ else
+ _aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh
+ fi
fi
[[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path