Add support for AWS Tools Profile.

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
This commit is contained in:
Bill Moritz
2015-12-05 11:52:58 -05:00
parent 725e1b2f76
commit b967674e6c

View File

@@ -188,9 +188,9 @@ function svn_prompt_vars {
}
# this functions returns absolute location of .hg directory if one exists
# It starts in the current directory and moves its way up until it hits /.
# It starts in the current directory and moves its way up until it hits /.
# If we get to / then no Mercurial repository was found.
# Example:
# Example:
# - lets say we cd into ~/Projects/Foo/Bar
# - .hg is located in ~/Projects/Foo/.hg
# - get_hg_root starts at ~/Projects/Foo/Bar and sees that there is no .hg directory, so then it goes into ~/Projects/Foo
@@ -221,7 +221,7 @@ function hg_prompt_vars {
HG_ROOT=$(get_hg_root)
if [ -f $HG_ROOT/branch ]; then
# Mercurial holds it's current branch in .hg/branch file
# Mercurial holds it's current branch in .hg/branch file
SCM_BRANCH=$(cat $HG_ROOT/branch)
else
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}')
@@ -352,3 +352,11 @@ if [ ! -e $BASH_IT/plugins/enabled/battery.plugin.bash ]; then
echo -n
}
fi
function aws_profile {
if [[ $AWS_DEFAULT_PROFILE ]]; then
echo -e "${AWS_DEFAULT_PROFILE}"
else
echo -e "default"
fi
}