Source

virtualenvwrapper / virtualenvwrapper_bashrc

Diff from to

File virtualenvwrapper_bashrc

 # Run a hook script in the current shell
 function virtualenvwrapper_source_hook () {
     scriptname="$1"
+    #echo "Looking for hook $scriptname"
     if [ -f "$scriptname" ]
     then
         source "$scriptname"
 function virtualenvwrapper_run_hook () {
     scriptname="$1"
     shift
+    #echo "Looking for hook $scriptname"
     if [ -x "$scriptname" ]
     then
         "$scriptname" "$@"
+    elif [ -e "$scriptname" ]
+    then
+        echo "Warning: Found \"$scriptname\" but it is not executable." 1>&2
     fi
 }
 
     then
         deactivate
     fi
+
+    virtualenvwrapper_run_hook "$WORKON_HOME/preactivate"
+    virtualenvwrapper_run_hook "$WORKON_HOME/$env_name/bin/preactivate"
     
     source "$activate"
     
     }'
     
     virtualenvwrapper_source_hook "$WORKON_HOME/postactivate"
-
     virtualenvwrapper_source_hook "$VIRTUAL_ENV/bin/postactivate"    
     
 	return 0