From b967674e6cd4b909db657de214b03beafa61b58d Mon Sep 17 00:00:00 2001 From: Bill Moritz Date: Sat, 5 Dec 2015 11:52:58 -0500 Subject: [PATCH] Add support for AWS Tools Profile. http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html --- themes/base.theme.bash | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index fc5e529a..c491e5e5 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -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 +}