Doug Hellmann avatar Doug Hellmann committed 03a8e10

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

Comments (0)

Files changed (2)

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"

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.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.