Created
October 11, 2010 16:01
-
-
Save vagmi/620762 to your computer and use it in GitHub Desktop.
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
# Add these functions to your .profile to know the git branch, ruby version | |
# and the rvm gemset that you are currently using | |
function bash_git_branch | |
{ | |
git branch 2> /dev/null | grep \* | python -c "print '['+raw_input()[2:]+']'" 2> /dev/null | |
} | |
function ruby_version | |
{ | |
ruby -v 2> /dev/null | awk '{ print $2}' | |
} | |
function rvm_gemset | |
{ | |
rvm gemset name 2> /dev/null|awk '{if ($0=="") print ""; else print "@" $0 }' 2> /dev/null | |
} | |
# you can turbocharge your command prompt to display them. | |
export PS1="\u@\h \w\$(bash_git_branch) r(\$(ruby_version)\$(rvm_gemset)) \$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment