Skip to content

Commit 963ea3f

Browse files
committed
shortcut initialization if it has run before
1 parent deae3d5 commit 963ea3f

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

docs/en/history.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dev
1010
- Drops support for Python 2.4 and 2.5. The tools may still work,
1111
but I no longer have a development environment set up for testing
1212
them, so I do not officially support them.
13+
- Shortcut initialization if it has run before.
1314

1415
2.10.1
1516

tests/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ oneTimeTearDown() {
1919
setUp () {
2020
echo
2121
rm -f "$test_dir/catch_output"
22+
unset VIRTUALENVWRAPPER_INITIALIZED
2223
}
2324

2425
test_virtualenvwrapper_initialize() {

tests/test_project.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ oneTimeTearDown() {
2222
setUp () {
2323
echo
2424
rm -f "$test_dir/catch_output"
25+
unset VIRTUALENVWRAPPER_INITIALIZED
2526
}
2627

2728
test_initialize() {

virtualenvwrapper.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ function virtualenvwrapper_setup_tab_completion {
204204

205205
# Set up virtualenvwrapper properly
206206
function virtualenvwrapper_initialize {
207+
if [ ! -z "$VIRTUALENVWRAPPER_INITIALIZED" ]
208+
then
209+
return 0
210+
fi
207211
export WORKON_HOME="$(virtualenvwrapper_derive_workon_home)"
208212

209213
virtualenvwrapper_verify_workon_home -q || return 1
@@ -229,6 +233,9 @@ function virtualenvwrapper_initialize {
229233

230234
virtualenvwrapper_setup_tab_completion
231235

236+
export VIRTUALENVWRAPPER_INITIALIZED=1
237+
238+
return 0
232239
}
233240

234241

0 commit comments

Comments
 (0)