diff --git a/zsh.d/zshfunctions/awsprofile b/zsh.d/zshfunctions/awsprofile index 114fbe4..f7ef23f 100644 --- a/zsh.d/zshfunctions/awsprofile +++ b/zsh.d/zshfunctions/awsprofile @@ -1,5 +1,10 @@ profile=$1 +if [ ! -f ~/.aws/config ]; then + echo "no aws config file found, bailing out..." + return 1 +fi + if [ $profile ]; then # We got a profile pattern, look for a match match=$(grep -E "\[profile .*$profile.*" ~/.aws/config | sed -E 's/\[profile (.+)\]/\1/') # Array of matching profiles match_no=$(echo $match|wc -l) # Number of profile matching diff --git a/zsh.d/zshfunctions/awsprofile.zwc b/zsh.d/zshfunctions/awsprofile.zwc index 1d289ec..f71fd1b 100644 Binary files a/zsh.d/zshfunctions/awsprofile.zwc and b/zsh.d/zshfunctions/awsprofile.zwc differ