Skip to content

Instantly share code, notes, and snippets.

@henryk
henryk / .bashrc
Last active August 29, 2015 14:04 — forked from todb/.bashrc
Output [] for rvm only when present
# Git and RVM prompting
function git-current-branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
function ruby-current-rvm {
FOO=$(~/.rvm/bin/rvm-prompt v p g)
if [ -n "${FOO}" ]; then echo "[${FOO}] "; fi
}
export PS1="\$(ruby-current-rvm)\$(git-current-branch)$PS1"