Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nuxlli
Created November 17, 2010 21:50
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 nuxlli/704162 to your computer and use it in GitHub Desktop.
Save nuxlli/704162 to your computer and use it in GitHub Desktop.
Função para capturar a versão atual do rvm e mostrar ela no prompt, dependendo da existência de arquivo Rakefile ou *.rb no diretório corrente.
function rvm_version {
if [[ -f ~/.rvm/bin/rvm-prompt ]]; then
RVM_VERSION=`~/.rvm/bin/rvm-prompt`
GEM_SET="$(echo $GEM_PATH | awk -F'%' '{print $2}')"
if ([ -f "$(pwd)/Rakefile" ] || [ "$(find . -maxdepth 1 -name '*.rb' | head -n1)" != "" ]) && [ ! -z "$RVM_VERSION" ]; then
echo "${RVM_VERSION} "
fi
fi
}
@taq
Copy link

taq commented Nov 17, 2010

Massa! Eu dei uma adaptada, dá uma olhada:
https://gist.github.com/704205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment