bash script that displays the current ruby in use by rvm as part of the prompt
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
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