Commits

Doug Hellmann committed b770006

add some debugging and a test to try to reproduce problem with log directory variable; addresses #95

  • Participants
  • Parent commits 2d609c7

Comments (0)

Files changed (2)

File tests/test_run_hook.sh

     assertSame "Errno 13] Permission denied" "$error"
 }
 
+test_virtualenvwrapper_run_hook_without_log_dir() {
+    old_log_dir="$VIRTUALENVWRAPPER_LOG_DIR"
+    unset VIRTUALENVWRAPPER_LOG_DIR
+    assertFalse "virtualenvwrapper_run_hook initialize"
+    export VIRTUALENVWRAPPER_LOG_DIR="$old_log_dir"
+}
+
 . "$test_dir/shunit2"

File virtualenvwrapper.sh

         echo "ERROR: Could not create temporary file name. Make sure TMPDIR is set." 1>&2
         return 1
     fi
+    if [ -z "$VIRTUALENVWRAPPER_LOG_DIR" ]
+    then
+        echo "ERROR: VIRTUALENVWRAPPER_LOG_DIR is not set." 1>&2
+        return 1
+    fi
     "$VIRTUALENVWRAPPER_PYTHON" -c 'from virtualenvwrapper.hook_loader import main; main()' $HOOK_VERBOSE_OPTION --script "$hook_script" "$@"
     result=$?