Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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