diff --git a/README.rst b/README.rst index f1be661..0e1264f 100644 --- a/README.rst +++ b/README.rst @@ -120,4 +120,4 @@ Convenience Commands Hooks ---------- -To run some commands after ``mkvirtualenv`` you can use hooks. First you need to define ``VIRTUALENVWRAPPER_HOOK_DIR`` variable. If it is set ``mkvirtualenv`` will run ``postmkvirtualenv.bat`` script from that directory. +To run some commands after ``mkvirtualenv`` you can use hooks. First you need to define ``VIRTUALENVWRAPPER_HOOK_DIR`` variable. If it is set ``mkvirtualenv`` will run ``postmkvirtualenv.bat`` script and ``workon`` will run ``postactivate.bat`` script from that directory. diff --git a/scripts/workon.bat b/scripts/workon.bat index b1d2cc3..1922cd0 100644 --- a/scripts/workon.bat +++ b/scripts/workon.bat @@ -71,4 +71,13 @@ if exist "%WORKON_HOME%\%VENV%\%VIRTUALENVWRAPPER_PROJECT_FILENAME%" ( ) ) +REM Run postactivate.bat + +if defined VIRTUALENVWRAPPER_HOOK_DIR ( + if exist "%VIRTUALENVWRAPPER_HOOK_DIR%\postactivate.bat" ( + call "%VIRTUALENVWRAPPER_HOOK_DIR%\postactivate.bat" + ) +) + + :END