envy theme to implement rbenv version promt

This commit is contained in:
Victor Castell
2011-11-05 13:08:34 +01:00
parent b59ee658f7
commit 76fcb58099
2 changed files with 26 additions and 0 deletions

View File

@@ -24,6 +24,9 @@ RVM_THEME_PROMPT_SUFFIX='|'
VIRTUALENV_THEME_PROMPT_PREFIX=' |'
VIRTUALENV_THEME_PROMPT_SUFFIX='|'
RBENV_THEME_PROMPT_PREFIX=' |'
RBENV_THEME_PROMPT_SUFFIX='|'
function scm {
if [[ -d .git ]]; then SCM=$SCM_GIT
elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT
@@ -113,6 +116,13 @@ function rvm_version_prompt {
fi
}
function rbenv_version_prompt {
if which rbenv &> /dev/null; then
rbenv=$(rbenv global) || return
echo -e "$RBENV_THEME_PROMPT_PREFIX$rbenv$RBENV_THEME_PROMPT_SUFFIX"
fi
}
function virtualenv_prompt {
if which virtualenv &> /dev/null; then
virtualenv=$([ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`") || return