Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

silly heroku

  • Loading branch information...
commit 2af73f6a3a47ee1a64c9be5fa4a703f881fb7ca5 1 parent 0e82c55
Jonas Obrist ojii authored
Showing with 7 additions and 55 deletions.
  1. +2 −51 bin/detect
  2. +5 −4 bin/steps/django
53 bin/detect
View
@@ -11,55 +11,6 @@
# Compiling an app into a slug is simple:
#
# $ bin/detect <build-dir> <cache-dir>
+# For now, djese is always Python/Django
-BUILD_DIR=$1
-
-# Exit early if app is clearly not Python.
-if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ]; then
- exit 1
-fi
-
-# If only `setup.py`, assume that the app is not Django.
-if [ ! -f $BUILD_DIR/requirements.txt ]; then
- echo Python
- exit 0
-fi
-
-# `Python/Django` if `**/settings.py` is present and `django` exists in
-# `requirements.txt`.
-#
-# Otherwise, `Python`.
-
-array=""
-list_requirements() {
-IFS_BAK=$IFS
-IFS="
-"
- requirement_file=$1
- reqs=$(cat $requirement_file)
- for req in $reqs; do
- if [[ $req == -r* ]]; then
- new_req=$(echo $req | cut -d" " -f2)
- if [[ $new_req == $1 ]]; then
- continue
- fi
- directory=$(dirname $requirement_file)
- if [[ ! $array == *$directory/$new_req* ]]; then
- list_requirements "$directory/$new_req"
- fi
- array="$array $directory/$new_req"
- else
- echo $req;
- fi
-
- done
-IFS=$IFS_BAK
-IFS_BAK=
-}
-
-
-
-SETTINGS_FILE=$(find $BUILD_DIR/. -maxdepth 3 -type f -name 'settings.py' | head -1)
-
-
-[ -n "$SETTINGS_FILE" ] && ( list_requirements $BUILD_DIR/requirements.txt | grep -Fiq "django" ) && echo Python/Django || echo Python
+echo Python/Django
9 bin/steps/django
View
@@ -13,10 +13,11 @@
#
# Reject a Django app that appears to be packaged incorrectly.
-if [ -f settings.py ]; then
- echo " ! Django app must be in a package subdirectory"
- exit 1
-fi
+# Actually, let's not do that because it's stupid
+#if [ -f settings.py ]; then
+# echo " ! Django app must be in a package subdirectory"
+# exit 1
+#fi
echo "-----> Injecting Django settings..."
Please sign in to comment.
Something went wrong with that request. Please try again.