Created
November 17, 2010 21:50
-
-
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.
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 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Massa! Eu dei uma adaptada, dá uma olhada:
https://gist.github.com/704205