7931d5ce1a72cc49cc64478042bc3ef3b667ac8e
- Author
- Superbil <superbil@gmail.com>
- Committer
- Superbil <superbil@gmail.com>
- Date
Message
Fix aws.plugins.zsh check rule
Check _aws_zsh_completer_path had exist or not
Diff
1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
2index de786725f6660624ae982684c346b320515a8c2f..0ae18dd561f9a052cb5a49a01b9ac7c2cd47203f 100644
3--- a/plugins/aws/aws.plugin.zsh
4+++ b/plugins/aws/aws.plugin.zsh
5@@ -22,7 +22,10 @@ function aws_profiles {
6 compctl -K aws_profiles asp
7
8 if _homebrew-installed && _awscli-homebrew-installed ; then
9- source $(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh
10+ _aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh
11 else
12- source `which aws_zsh_completer.sh`
13+ _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
14 fi
15+
16+[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
17+unset _aws_zsh_completer_path