summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2019-05-25 10:24:43 +0200
committerGitHub <noreply@github.com>2019-05-25 10:24:43 +0200
commit9598a855fa55f9f126f099a4ab792335d2dc1a69 (patch)
tree180cd72eb0c4244d9748fab8b6e9c15750bac592
parentfa187791cad4447029402a236f70d98424f511ee (diff)
downloadzsh-9598a855fa55f9f126f099a4ab792335d2dc1a69.tar.gz
zsh-9598a855fa55f9f126f099a4ab792335d2dc1a69.tar.bz2
zsh-9598a855fa55f9f126f099a4ab792335d2dc1a69.zip
aws: check for existence of config file in aws_profiles
Fixes #7872
-rw-r--r--plugins/aws/aws.plugin.zsh1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index d70a64fcc..b78cd2ac1 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -33,6 +33,7 @@ function aws_change_access_key {
}
function aws_profiles {
+ [[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1
reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
}
compctl -K aws_profiles asp aws_change_access_key