|
50 | 50 | VIRTUALENVWRAPPER_PYTHON="$(\which python)" |
51 | 51 | fi |
52 | 52 |
|
| 53 | +# Set the name of the virtualenv app to use. |
| 54 | +if [ "$VIRTUALENVWRAPPER_VIRTUALENV" = "" ] |
| 55 | +then |
| 56 | + VIRTUALENVWRAPPER_VIRTUALENV="virtualenv" |
| 57 | +fi |
| 58 | + |
53 | 59 | virtualenvwrapper_derive_workon_home() { |
54 | 60 | typeset workon_home_dir="$WORKON_HOME" |
55 | 61 |
|
@@ -149,15 +155,15 @@ virtualenvwrapper_initialize () { |
149 | 155 |
|
150 | 156 | # Verify that virtualenv is installed and visible |
151 | 157 | virtualenvwrapper_verify_virtualenv () { |
152 | | - typeset venv=$(\which virtualenv | (unset GREP_OPTIONS; \grep -v "not found")) |
| 158 | + typeset venv=$(\which "$VIRTUALENVWRAPPER_VIRTUALENV" | (unset GREP_OPTIONS; \grep -v "not found")) |
153 | 159 | if [ "$venv" = "" ] |
154 | 160 | then |
155 | | - echo "ERROR: virtualenvwrapper could not find virtualenv in your path" >&2 |
| 161 | + echo "ERROR: virtualenvwrapper could not find $VIRTUALENVWRAPPER_VIRTUALENV in your path" >&2 |
156 | 162 | return 1 |
157 | 163 | fi |
158 | 164 | if [ ! -e "$venv" ] |
159 | 165 | then |
160 | | - echo "ERROR: Found virtualenv in path as \"$venv\" but that does not exist" >&2 |
| 166 | + echo "ERROR: Found $VIRTUALENVWRAPPER_VIRTUALENV in path as \"$venv\" but that does not exist" >&2 |
161 | 167 | return 1 |
162 | 168 | fi |
163 | 169 | return 0 |
@@ -194,11 +200,13 @@ mkvirtualenv () { |
194 | 200 | virtualenvwrapper_verify_workon_home || return 1 |
195 | 201 | virtualenvwrapper_verify_virtualenv || return 1 |
196 | 202 | (cd "$WORKON_HOME" && |
197 | | - virtualenv "$@" && |
198 | | - [ -d "$WORKON_HOME/$envname" ] && virtualenvwrapper_run_hook "pre_mkvirtualenv" "$envname" |
| 203 | + "$VIRTUALENVWRAPPER_VIRTUALENV" "$@" && |
| 204 | + [ -d "$WORKON_HOME/$envname" ] && \ |
| 205 | + virtualenvwrapper_run_hook "pre_mkvirtualenv" "$envname" |
199 | 206 | ) |
200 | 207 | typeset RC=$? |
201 | 208 | [ $RC -ne 0 ] && return $RC |
| 209 | + |
202 | 210 | # If they passed a help option or got an error from virtualenv, |
203 | 211 | # the environment won't exist. Use that to tell whether |
204 | 212 | # we should switch to the environment and run the hook. |
|
0 commit comments