Commit d6fbb299 authored by Jonathan French's avatar Jonathan French

add CLEAN_VIRTUALENV option to purge and recreate virtualenv

parent 9d0bf98a
......@@ -160,9 +160,11 @@ puts-step "Creating Virtualenv version $(virtualenv --version)"
# Try to create the virtualenv.
OUT=$(virtualenv --python $PYTHON_EXE --distribute --never-download --prompt='(venv) ' $VIRTUALENV_LOC 2>&1)
# If there's an error, purge and recreate.
[ $? -ne 0 ] && {
puts-warn "Virtualenv corrupt, rebuilding."
[ $? -ne 0 -o -n "$CLEAN_VIRTUALENV" ] && {
if [ -n "$CLEAN_VIRTUALENV" ]
then echo " ! CLEAN_VIRTUALENV set, rebuilding virtualenv."
else echo " ! Virtualenv corrupt, rebuilding."
fi
for dir in $VIRTUALENV_DIRS; do
rm -fr $dir &> /dev/null || true
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment