Commits

Doug Hellmann  committed 03a8e10

check exit code of virtualenv before proceeding (fixes #56)

  • Participants
  • Parent commits 56ba25b

Comments (0)

Files changed (2)

File tests/test_mkvirtualenv.sh

     assertSame "$RC" "1"
 }
 
+test_no_args () {
+    mkvirtualenv 2>/dev/null 1>&2
+    RC=$?
+    assertSame "2" "$RC"
+}
+
 test_no_workon_home () {
     old_home="$WORKON_HOME"
     export WORKON_HOME="$WORKON_HOME/not_there"

File virtualenvwrapper.sh

         virtualenv "$@" &&
         [ -d "$WORKON_HOME/$envname" ] && virtualenvwrapper_run_hook "pre_mkvirtualenv" "$envname"
         )
+    typeset RC=$?
+    [ $RC -ne 0 ] && return $RC
     # If they passed a help option or got an error from virtualenv,
     # the environment won't exist.  Use that to tell whether
     # we should switch to the environment and run the hook.