@@ -8,6 +8,11 @@ The end-user customization scripts are either *sourced* (allowing them
8
8
to modify your shell environment) or *run * as an external program at
9
9
the appropriate trigger time.
10
10
11
+ The global scripts applied to all environments should be placed in the
12
+ directory named by :ref: `VIRTUALENVWRAPPER_HOOK_DIR
13
+ <variable-VIRTUALENVWRAPPER_HOOK_DIR>`. The local scripts should be
14
+ placed in the ``bin `` directory of the virtualenv.
15
+
11
16
.. _scripts-get_env_details :
12
17
13
18
get_env_details
@@ -17,7 +22,7 @@ get_env_details
17
22
:Argument(s): env name
18
23
:Sourced/Run: run
19
24
20
- ``$WORKON_HOME /get_env_details `` is run when ``workon `` is run with no
25
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /get_env_details `` is run when ``workon `` is run with no
21
26
arguments and a list of the virtual environments is printed. The hook
22
27
is run once for each environment, after the name is printed, and can
23
28
print additional information about that environment.
@@ -31,7 +36,7 @@ initialize
31
36
:Argument(s): None
32
37
:Sourced/Run: sourced
33
38
34
- ``$WORKON_HOME /initialize `` is sourced when ``virtualenvwrapper.sh ``
39
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /initialize `` is sourced when ``virtualenvwrapper.sh ``
35
40
is loaded into your environment. Use it to adjust global settings
36
41
when virtualenvwrapper is enabled.
37
42
@@ -44,7 +49,7 @@ premkvirtualenv
44
49
:Argument(s): name of new environment
45
50
:Sourced/Run: run
46
51
47
- ``$WORKON_HOME /premkvirtualenv `` is run as an external program after
52
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /premkvirtualenv `` is run as an external program after
48
53
the virtual environment is created but before the current environment
49
54
is switched to point to the new env. The current working directory for
50
55
the script is ``$WORKON_HOME `` and the name of the new environment is
@@ -59,7 +64,7 @@ postmkvirtualenv
59
64
:Argument(s): none
60
65
:Sourced/Run: sourced
61
66
62
- ``$WORKON_HOME /postmkvirtualenv `` is sourced after the new environment
67
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /postmkvirtualenv `` is sourced after the new environment
63
68
is created and activated.
64
69
65
70
.. _scripts-precpvirtualenv :
@@ -71,7 +76,7 @@ precpvirtualenv
71
76
:Argument(s): name of original environment, name of new environment
72
77
:Sourced/Run: run
73
78
74
- ``$WORKON_HOME /precpvirtualenv `` is run as an external program after
79
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /precpvirtualenv `` is run as an external program after
75
80
the source environment is duplicated and made relocatable, but before
76
81
the ``premkvirtualenv `` hook is run or the current environment is
77
82
switched to point to the new env. The current working directory for
@@ -87,7 +92,7 @@ postcpvirtualenv
87
92
:Argument(s): none
88
93
:Sourced/Run: sourced
89
94
90
- ``$WORKON_HOME /postcpvirtualenv `` is sourced after the new environment
95
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /postcpvirtualenv `` is sourced after the new environment
91
96
is created and activated.
92
97
93
98
.. _scripts-preactivate :
@@ -99,7 +104,7 @@ preactivate
99
104
:Argument(s): environment name
100
105
:Sourced/Run: run
101
106
102
- The global ``$WORKON_HOME /preactivate `` script is run before the new
107
+ The global ``$VIRTUALENVWRAPPER_HOOK_DIR /preactivate `` script is run before the new
103
108
environment is enabled. The environment name is passed as the first
104
109
argument.
105
110
@@ -116,7 +121,7 @@ postactivate
116
121
:Argument(s): none
117
122
:Sourced/Run: sourced
118
123
119
- The global ``$WORKON_HOME /postactivate `` script is sourced after the
124
+ The global ``$VIRTUALENVWRAPPER_HOOK_DIR /postactivate `` script is sourced after the
120
125
new environment is enabled. ``$VIRTUAL_ENV `` refers to the new
121
126
environment at the time the script runs.
122
127
@@ -155,7 +160,7 @@ current environment is deactivated, and can be used to disable or
155
160
clear settings in your environment. ``$VIRTUAL_ENV `` refers to the old
156
161
environment at the time the script runs.
157
162
158
- The global ``$WORKON_HOME /predeactivate `` script is sourced before the
163
+ The global ``$VIRTUALENVWRAPPER_HOOK_DIR /predeactivate `` script is sourced before the
159
164
current environment is deactivated. ``$VIRTUAL_ENV `` refers to the
160
165
old environment at the time the script runs.
161
166
@@ -182,7 +187,7 @@ prermvirtualenv
182
187
:Argument(s): environment name
183
188
:Sourced/Run: run
184
189
185
- The ``$WORKON_HOME /prermvirtualenv `` script is run as an external
190
+ The ``$VIRTUALENVWRAPPER_HOOK_DIR /prermvirtualenv `` script is run as an external
186
191
program before the environment is removed. The full path to the
187
192
environment directory is passed as an argument to the script.
188
193
@@ -195,6 +200,6 @@ postrmvirtualenv
195
200
:Argument(s): environment name
196
201
:Sourced/Run: run
197
202
198
- The ``$WORKON_HOME /postrmvirtualenv `` script is run as an external
203
+ The ``$VIRTUALENVWRAPPER_HOOK_DIR /postrmvirtualenv `` script is run as an external
199
204
program after the environment is removed. The full path to the
200
205
environment directory is passed as an argument to the script.
0 commit comments