Skip to content
Browse files

Automated activating of virtualenvs

  • Loading branch information...
1 parent c091b93 commit 224734d946a3c501e4902a81d5173e4986baf2f0 @anttihirvonen committed Apr 2, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 bashrc
View
3 bashrc
@@ -4,6 +4,9 @@
# virtualenvwrapper
source /usr/local/bin/virtualenvwrapper.sh
+# if there's virtualenv with same name as the directory, activate the environment
+# http://kfalck.net/2012/03/14/aktivoi-virtualenv-ymparisto-automaattisesti
+export PROMPT_COMMAND='[ -z "$VIRTUAL_ENV" -a -n "$WORKON_HOME" -a -d $WORKON_HOME/$(basename $PWD) ] && workon $(basename $PWD)'
# If not running interactively, don't do anything
[ -z "$PS1" ] && return

0 comments on commit 224734d

Please sign in to comment.
Something went wrong with that request. Please try again.