Skip to content

Instantly share code, notes, and snippets.

@mscottford
Created January 28, 2011 06:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mscottford/799933 to your computer and use it in GitHub Desktop.
bash script that displays the current ruby in use by rvm as part of the prompt
function red_text {
local LIGHT_RED="\[\033[1;31m\]"
local NO_COLOR="\[\033[0m\]"
echo "$LIGHT_RED$1$NO_COLOR"
}
function green_text {
local LIGHT_GREEN="\[\033[1;32m\]"
local NO_COLOR="\[\033[0m\]"
echo "$LIGHT_GREEN$1$NO_COLOR"
}
function rvm_prompt {
local RVM_PROMPT_CMD="~/.rvm/bin/rvm-prompt i v g s"
echo "'\$($RVM_PROMPT_CMD)'"
}
function include_rvm_in_prompt {
PS1="\n$(red_text ':rvm') => $(green_text "$(rvm_prompt)")\n$PS1"
}
include_rvm_in_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment