e8c328cb394e39f8d1c7d18b85b0be12bd71c556

Author
Hosh <hoshsadiq@users.noreply.github.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Update AWS completion (#6745)

Diff

 1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 2index 6a0e04add6e2454390dd89d4bb064de7f1e2ca72..a326e2e01d326975630667c90084e3da24253418 100644
 3--- a/plugins/aws/aws.plugin.zsh
 4+++ b/plugins/aws/aws.plugin.zsh
 5@@ -42,11 +42,11 @@ function aws_profiles {
 6 
 7 compctl -K aws_profiles asp
 8 
 9-if _homebrew-installed && _awscli-homebrew-installed ; then
10+if which aws_zsh_completer.sh &>/dev/null; then
11+  _aws_zsh_completer_path=$(which aws_zsh_completer.sh 2>/dev/null)
12+elif _homebrew-installed && _awscli-homebrew-installed; then
13   _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
14-else
15-  _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
16 fi
17 
18-[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
19+[ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
20 unset _aws_zsh_completer_path