Unverified Commit 9598a855 authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

aws: check for existence of config file in aws_profiles

Fixes #7872
parent fa187791
...@@ -33,6 +33,7 @@ function aws_change_access_key { ...@@ -33,6 +33,7 @@ function aws_change_access_key {
} }
function aws_profiles { 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/')) 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 compctl -K aws_profiles asp aws_change_access_key
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment