mirror of
https://github.com/akelge/zsh
synced 2025-07-03 05:05:28 +00:00
Added check for config file presence
This commit is contained in:
@ -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
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user