Created
October 17, 2012 01:01
-
-
Save evgkirov/3903143 to your computer and use it in GitHub Desktop.
virtualenvwrapper + rvm
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
PATH="/usr/local/bin:$PATH" | |
PS1="\[\033[01;32m\]\W\[\033[37m\]\$\[\033[00m\] " | |
export PIP_VIRTUALENV_BASE=$WORKON_HOME | |
export PIP_RESPECT_VIRTUALENV=true | |
source /usr/local/bin/virtualenvwrapper.sh | |
work_with_this() { | |
if [ -e .venv ]; then | |
workon `cat .venv` | |
fi | |
if [ -e ../.venv ]; then | |
workon `cat ../.venv` | |
fi | |
if [ -e .vagrant ]; then | |
vagrant ssh | |
fi | |
} | |
super_cd () { | |
cd "$@" && work_with_this | |
echo "" | |
echo -e "\033[1;31m"`pwd`"\033[0;39m" | |
} | |
runserver() { | |
if [ -e .rvmrc ]; then | |
rails s -p 8000 | |
else | |
python manage.py runserver | |
fi | |
} | |
alias rs="runserver" | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
alias cd="super_cd" | |
cd . |
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
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment