mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
new virtualenv build sequence
This commit is contained in:
+18
-5
@@ -53,11 +53,24 @@ for dir in $VIRTUALENV_DIRS; do
|
||||
cp -R $CACHE_DIR/$dir . &> /dev/null || true
|
||||
done
|
||||
|
||||
# Don't rebuild existing virtualenv.
|
||||
if ! [ -f "lib/python2.7" ]; then
|
||||
echo "-----> Preparing virtualenv version $(virtualenv --version)"
|
||||
virtualenv --distribute --never-download --prompt=venv . | indent
|
||||
fi
|
||||
|
||||
# Create virtualenv. Rebuild if corrupt.
|
||||
set +e
|
||||
|
||||
# Try to create the virtualenv.
|
||||
OUT=$(virtualenv --distribute --never-download --prompt=venv . )
|
||||
|
||||
# If there's an error, purge and recreate.
|
||||
[ $? -ne 0 ] && {
|
||||
echo " ! Virtualenv corrupt, rebuilding."
|
||||
for dir in $VIRTUALENV_DIRS; do
|
||||
rm -fr $dir &> /dev/null || true
|
||||
done
|
||||
OUT=$(virtualenv --distribute --never-download --prompt=venv . )
|
||||
}
|
||||
echo "$OUT" | indent
|
||||
|
||||
set -e
|
||||
|
||||
# Create set-aside .heroku folder.
|
||||
mkdir -p .heroku
|
||||
|
||||
Reference in New Issue
Block a user