check for django in requirements.txt

This commit is contained in:
Kenneth Reitz
2012-03-06 04:46:16 -05:00
parent 1b0fd2e4b6
commit a0f2073eb1
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -34,7 +34,9 @@ cd $BUILD_DIR
# Reject a non-packaged Django app.
if [ "$NAME" = "Python" ]; then
[ -f manage.py ] && [ -f settings.py ] && { echo " ! Django app must be in a package subdirectory"; exit 1; }
[ -f settings.py ] && { echo " ! Django settings must be in a package subdirectory"; exit 1; }
(grep -Fiq "django" requirements.txt) && [ -f settings.py ] && { echo " ! Django app must be in a package subdirectory"; exit 1; }
fi
# Warn a checked-in virtualenv.
+2 -2
View File
@@ -3,9 +3,9 @@
BUILD_DIR=$1
if [ -f $BUILD_DIR/requirements.txt ] || [ -f $BUILD_DIR/setup.py ]; then
if [ ! -f $BUILD_DIR/requirements.txt ] || [ ! -f $BUILD_DIR/setup.py ]; then
exit 1
fi
# 'Python/Django' if there is a [mysite]/settings.py file present; otherwise 'Python'
ls $BUILD_DIR/**/settings.py &> /dev/null && echo Python/Django || echo Python
ls $BUILD_DIR/**/settings.py &> /dev/null && (grep -Fiq "django" requirements.txt) && echo Python/Django || echo Python