Skip to content

Instantly share code, notes, and snippets.

@henryk
Forked from todb/.bashrc
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henryk/cd50c9ba7f75d98e2137 to your computer and use it in GitHub Desktop.
Save henryk/cd50c9ba7f75d98e2137 to your computer and use it in GitHub Desktop.
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment