Skip to content

Instantly share code, notes, and snippets.

@evgkirov
Created October 17, 2012 01:01
Show Gist options
  • Save evgkirov/3903143 to your computer and use it in GitHub Desktop.
Save evgkirov/3903143 to your computer and use it in GitHub Desktop.
virtualenvwrapper + rvm
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 .
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