Guest User

Untitled

a guest
Jun 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # Add these functions to your .profile to know the git branch, ruby version
  2. # and the rvm gemset that you are currently using
  3.  
  4. function bash_git_branch
  5. {
  6. git branch 2> /dev/null | grep \* | python -c "print '['+raw_input()[2:]+']'" 2> /dev/null
  7. }
  8. function ruby_version
  9. {
  10. ruby -v 2> /dev/null | awk '{ print $2}'
  11. }
  12. function rvm_gemset
  13. {
  14. rvm gemset name 2> /dev/null|awk '{if ($0=="") print ""; else print "@" $0 }' 2> /dev/null
  15. }
  16.  
  17. # you can turbocharge your command prompt to display them.
  18. export PS1="\u@\h \w\$(bash_git_branch) r(\$(ruby_version)\$(rvm_gemset)) \$ "
Add Comment
Please, Sign In to add comment