Skip to content

Commit 639fe5d

Browse files
committed
add some debugging and a test to try to reproduce problem with log directory variable; addresses #95
1 parent c23f915 commit 639fe5d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/test_run_hook.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,11 @@ test_virtualenvwrapper_run_hook_permissions() {
6767
assertSame "Errno 13] Permission denied" "$error"
6868
}
6969

70+
test_virtualenvwrapper_run_hook_without_log_dir() {
71+
old_log_dir="$VIRTUALENVWRAPPER_LOG_DIR"
72+
unset VIRTUALENVWRAPPER_LOG_DIR
73+
assertFalse "virtualenvwrapper_run_hook initialize"
74+
export VIRTUALENVWRAPPER_LOG_DIR="$old_log_dir"
75+
}
76+
7077
. "$test_dir/shunit2"

virtualenvwrapper.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ virtualenvwrapper_run_hook () {
133133
echo "ERROR: Could not create temporary file name. Make sure TMPDIR is set." 1>&2
134134
return 1
135135
fi
136+
if [ -z "$VIRTUALENVWRAPPER_LOG_DIR" ]
137+
then
138+
echo "ERROR: VIRTUALENVWRAPPER_LOG_DIR is not set." 1>&2
139+
return 1
140+
fi
136141
"$VIRTUALENVWRAPPER_PYTHON" -c 'from virtualenvwrapper.hook_loader import main; main()' $HOOK_VERBOSE_OPTION --script "$hook_script" "$@"
137142
result=$?
138143

0 commit comments

Comments
 (0)