Skip to content

Instantly share code, notes, and snippets.

@taq
Created November 17, 2010 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taq/704205 to your computer and use it in GitHub Desktop.
Save taq/704205 to your computer and use it in GitHub Desktop.
__rvm_ps1 () {
if [ ! -f ~/.rvm/bin/rvm-prompt ]; then
exit 0
fi
RVM_VERSION=$(~/.rvm/bin/rvm-prompt)
FMT="%s"
if ([ -f "$(pwd)/Rakefile" ] ||
[ "$(find . -maxdepth 1 -name '*.rb' | head -n1)" != "" ]) &&
[ ! -z "$RVM_VERSION" ]; then
if [ -n "$1" ]; then
FMT="$1"
fi
printf "$FMT" "$RVM_VERSION"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment