-
-
Save henryk/cd50c9ba7f75d98e2137 to your computer and use it in GitHub Desktop.
Output [] for rvm only when present
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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