summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuperbil <superbil@gmail.com>2014-12-16 00:17:58 +0800
committerSuperbil <superbil@gmail.com>2014-12-16 00:51:22 +0800
commit7931d5ce1a72cc49cc64478042bc3ef3b667ac8e (patch)
treea58db7442eed91482886f2a660718f70fbed6b11
parent1978a0923c864cacdc520adff83ed63f62c91073 (diff)
downloadzsh-7931d5ce1a72cc49cc64478042bc3ef3b667ac8e.tar.gz
zsh-7931d5ce1a72cc49cc64478042bc3ef3b667ac8e.tar.bz2
zsh-7931d5ce1a72cc49cc64478042bc3ef3b667ac8e.zip
Fix aws.plugins.zsh check rule
Check _aws_zsh_completer_path had exist or not
-rw-r--r--plugins/aws/aws.plugin.zsh7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index de786725f..0ae18dd56 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -22,7 +22,10 @@ function aws_profiles {
compctl -K aws_profiles asp
if _homebrew-installed && _awscli-homebrew-installed ; then
- source $(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh
+ _aws_zsh_completer_path=$(brew --prefix)/opt/awscli/libexec/bin/aws_zsh_completer.sh
else
- source `which aws_zsh_completer.sh`
+ _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
fi
+
+[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
+unset _aws_zsh_completer_path