mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Merge pull request #47 from ojno/master
Option to purge and recreate virtualenv
This commit is contained in:
+7
-5
@@ -160,12 +160,14 @@ 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
|
||||
done
|
||||
OUT=$(virtualenv --python $PYTHON_EXE --distribute --never-download --prompt='(venv) ' $VIRTUALENV_LOC )
|
||||
}
|
||||
echo "$OUT" | indent
|
||||
@@ -222,4 +224,4 @@ done
|
||||
# Experimental post_compile hook.
|
||||
source $BIN_DIR/steps/hooks/post_compile
|
||||
|
||||
# <a href="http://github.com/heroku/heroku-buildpack-python"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
|
||||
# <a href="http://github.com/heroku/heroku-buildpack-python"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
|
||||
|
||||
Reference in New Issue
Block a user