Bill Moritz 2015-12-05 11:52:58 -05:00
parent 725e1b2f76
commit b967674e6c
1 changed files with 11 additions and 3 deletions

View File

@ -188,9 +188,9 @@ function svn_prompt_vars {
} }
# this functions returns absolute location of .hg directory if one exists # 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. # If we get to / then no Mercurial repository was found.
# Example: # Example:
# - lets say we cd into ~/Projects/Foo/Bar # - lets say we cd into ~/Projects/Foo/Bar
# - .hg is located in ~/Projects/Foo/.hg # - .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 # - 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) HG_ROOT=$(get_hg_root)
if [ -f $HG_ROOT/branch ]; then 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) SCM_BRANCH=$(cat $HG_ROOT/branch)
else else
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}') 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 echo -n
} }
fi fi
function aws_profile {
if [[ $AWS_DEFAULT_PROFILE ]]; then
echo -e "${AWS_DEFAULT_PROFILE}"
else
echo -e "default"
fi
}