9598a855fa55f9f126f099a4ab792335d2dc1a69

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

Message

aws: check for existence of config file in aws_profiles

Fixes #7872

Diff

 1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 2index d70a64fcc61365596f4791fcb117d3a6891bbf57..b78cd2ac1efa6701d492660359c0479ebbe1bbaa 100644
 3--- a/plugins/aws/aws.plugin.zsh
 4+++ b/plugins/aws/aws.plugin.zsh
 5@@ -33,6 +33,7 @@ function aws_change_access_key {
 6 }
 7 
 8 function aws_profiles {
 9+  [[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1
10   reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
11 }
12 compctl -K aws_profiles asp aws_change_access_key