Create a gist now

Instantly share code, notes, and snippets.

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