diff --git a/bash_aliases b/bash_aliases index 9c77a27..3738de1 100644 --- a/bash_aliases +++ b/bash_aliases @@ -119,9 +119,9 @@ function prompt_ps1_git_branch() function prompt_ps1_svn_branch() { if [ -e .svn ]; then - url_out=$(command svn info 2>/dev/null | grep '^URL:') - re_branch="\\<(tags|branches)/([^/]*)\\>" - re_trunk="\\" + local url_out=$(command svn info 2>/dev/null | grep '^URL:') + local re_branch="\\<(tags|branches)/([^/]*)\\>" + local re_trunk="\\" if [[ "$url_out" =~ $re_branch ]]; then echo "${BASH_REMATCH[2]} " elif [[ "$url_out" =~ $re_trunk ]]; then @@ -130,6 +130,14 @@ function prompt_ps1_svn_branch() fi } +function prompt_ps1_rvm_gemset() +{ + local re="rvm.*@(.*)" + if [[ "$GEM_HOME" =~ $re ]]; then + echo "${BASH_REMATCH[1]} " + fi +} + # elapsed time PS1="$(ps-color bold blue)\$(prompt_ps1_elapsed_time \D{%s})" # exit status @@ -149,6 +157,8 @@ PS1="${PS1}$(ps-color bold blue)\$(prompt_ps1_job_count \\j)" PS1="${PS1}$(ps-color bold green)\$(prompt_ps1_shlvl)" # \n PS1="${PS1}$(ps-color reset)\n" +# rvm gemset +PS1="${PS1}$(ps-color bold green)\$(prompt_ps1_rvm_gemset)" # git/svn info PS1="${PS1}$(ps-color bold yellow)\$(prompt_ps1_git_branch)\$(prompt_ps1_svn_branch)" # dollar