From 87fa376b4d3c5ec11e915d974c73a0d8ad04b8d8 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz <me@kennethreitz.com> Date: Thu, 10 Nov 2011 11:25:25 -0800 Subject: [PATCH] checked in virtualenv safety check --- bin/compile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index f4a20720..e5d4fa40 100755 --- a/bin/compile +++ b/bin/compile @@ -33,6 +33,12 @@ if [ "$NAME" = "Python" ]; then [ -f manage.py ] && [ -f settings.py ] && { echo " ! Django app must be in a package subdirectory"; exit 1; } fi +# reject a checked-in virtualenv +if [ -d "lib" ] || [ -d "bin" ]; then + echo " ! You have a virtualenv checked in. You should ignore the appropriate paths in your repo. See http://devcenter.heroku.com/articles/gitignore for more info."; + exit 1; +fi + # copy artifacts out of cache if exists mkdir -p $CACHE_DIR for dir in $VIRTUALENV_DIRS; do @@ -49,7 +55,7 @@ if [ "$NAME" = "Python/Django" ]; then SETTINGS_FILE=$(ls **/settings.py | head -1) PROJECT=$(dirname $SETTINGS_FILE) echo "Injecting code into $SETTINGS_FILE to read from DATABASE_URL" | indent - + cat >>$SETTINGS_FILE <<EOF import os, sys, urlparse -- GitLab