Doug Hellmann  committed 3ff85eb Merge

merge ChrisHas35's postactivatehook changes

  • Participants
  • Parent commits 634b8d2, 23827b3
  • Branches default

Comments (0)

Files changed (3)

 be used to disable or clear settings in your environment. ``$VIRTUAL_ENV`` refers to the old
 environment at the time the script runs.
+The global ``postactivate`` script is sourced after the new environment is enabled and the new
+environment's postactivate is sourced (if it exists). ``$VIRTUAL_ENV`` refers to the new
+environment at the time the script runs.
+This example script adds a space between the virtual environment name and your old PS1 by making
+use of ``_OLD_VIRTUAL_PS1``.
+    PS1="(`basename \"$VIRTUAL_ENV\"`) $_OLD_VIRTUAL_PS1"
   - Pull in fix for colorized ls from Jeff Forcier (b42a25f7b74a).
+  - Add global postactivate hook.
   - Add more hooks for operations to run before and after creating or deleting environments based on changes from Chris Hasenpflug.
 mk_test_hook postmkvirtualenv
 mk_test_hook prermvirtualenv
 mk_test_hook postrmvirtualenv
+mk_test_hook postactivate
 echo "HOOKS:"

File virtualenvwrapper_bashrc

     source "$activate"
     virtualenvwrapper_source_hook "$VIRTUAL_ENV/bin/postactivate"
+    virtualenvwrapper_source_hook "$WORKON_HOME/postactivate"
 	return 0