Skip to content

Commit f19032a

Browse files
committed
fix the postmkvirtualenv hook
1 parent 51ef687 commit f19032a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tests/test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ test_mkvirtualenv_activates () {
7070
assertSame "env2" $(basename "$VIRTUAL_ENV")
7171
}
7272

73+
test_postmkvirtualenv () {
74+
echo "echo GLOBAL postmkvirtualenv > $test_dir/catch_output" > "$WORKON_HOME/postmkvirtualenv"
75+
mkvirtualenv "env3"
76+
output=$(cat "$test_dir/catch_output")
77+
expected="GLOBAL postmkvirtualenv"
78+
assertSame "$expected" "$output"
79+
rm -f "$WORKON_HOME/postmkvirtualenv"
80+
deactivate
81+
rmvirtualenv "env3"
82+
}
83+
7384
test_no_virtualenv () {
7485
old_path="$PATH"
7586
PATH="/usr/bin:/usr/local/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$HOME/bin"

virtualenvwrapper_bashrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function mkvirtualenv () {
173173
virtualenvwrapper_make_hook "$WORKON_HOME/$envname/bin/postdeactivate" "This hook is sourced after the virtualenv is deactivated."
174174
# Now activate the new environment
175175
workon "$envname"
176-
virtualenvwrapper_source_hook "$WORKON_HOME/$envname/postmkvirtualenv"
176+
virtualenvwrapper_source_hook "$WORKON_HOME/postmkvirtualenv"
177177
}
178178

179179
# Remove an environment, in the WORKON_HOME.

0 commit comments

Comments
 (0)