Commit 20249f96 authored by Kenneth Reitz's avatar Kenneth Reitz

MANAGE_FILE

parent 8b55e73f
...@@ -21,7 +21,7 @@ EOF ...@@ -21,7 +21,7 @@ EOF
[ "$NAME" = "Python/Django" ] || exit 0 [ "$NAME" = "Python/Django" ] || exit 0
MANAGE_FILE=$(cd $BUILD_DIR && find . -maxdepth 2 -type f -name 'manage.py' | head -1) MANAGE_FILE=$(cd $BUILD_DIR && find . -maxdepth 3 -type f -name 'manage.py' | head -1)
MANAGE_FILE=${MANAGE_FILE:2} MANAGE_FILE=${MANAGE_FILE:2}
PROJECT=$(dirname $MANAGE_FILE) PROJECT=$(dirname $MANAGE_FILE)
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
set +e set +e
# Check if collectstatic is configured. # Check if collectstatic is configured.
python $PROJECT/manage.py collectstatic --help &> /dev/null && RUN_COLLECTSTATIC=true python $MANAGE_FILE collectstatic --help &> /dev/null && RUN_COLLECTSTATIC=true
# Don't raise errors if SILENCE_COLLECTSTATIC is set. # Don't raise errors if SILENCE_COLLECTSTATIC is set.
if [ ! "$SILENCE_COLLECTSTATIC" ]; then if [ ! "$SILENCE_COLLECTSTATIC" ]; then
set -e set -e
fi fi
# Compile assets if collectstatic appears to be . # Compile assets if collectstatic appears to be kosher.
if [ "$RUN_COLLECTSTATIC" ]; then if [ "$RUN_COLLECTSTATIC" ]; then
echo "-----> Collecting static files" echo "-----> Collecting static files"
python $PROJECT/manage.py collectstatic --noinput --verbosity=0 | indent python $MANAGE_FILE collectstatic --noinput --verbosity=0 | indent
[ $? -ne 0 ] && { [ $? -ne 0 ] && {
echo " ! Error running manage.py collectstatic. More info:" echo " ! Error running manage.py collectstatic. More info:"
...@@ -22,6 +22,4 @@ if [ "$RUN_COLLECTSTATIC" ]; then ...@@ -22,6 +22,4 @@ if [ "$RUN_COLLECTSTATIC" ]; then
else else
echo " ! Django collecstatic is not configured. Learn more:" echo " ! Django collecstatic is not configured. Learn more:"
echo " http://devcenter.heroku.com/articles/django-assets" echo " http://devcenter.heroku.com/articles/django-assets"
fi fi
\ No newline at end of file
env
\ No newline at end of file
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
SETTINGS_FILE=$(find . -maxdepth 3 -type f -name 'settings.py' | head -1) SETTINGS_FILE=$(find . -maxdepth 3 -type f -name 'settings.py' | head -1)
PROJECT=$(dirname $SETTINGS_FILE) PROJECT=$(dirname $SETTINGS_FILE)
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1)
MANAGE_FILE=${MANAGE_FILE:2}
# Disable injection for new applications. # Disable injection for new applications.
if [ -f .heroku/injection_disabled ]; then if [ -f .heroku/injection_disabled ]; then
DISABLE_INJECTION=1 DISABLE_INJECTION=1
fi fi
export SETTINGS_FILE PROJECT DISABLE_INJECTION export SETTINGS_FILE MANAGE_FILE PROJECT DISABLE_INJECTION
if [ ! "$DISABLE_INJECTION" ]; then if [ ! "$DISABLE_INJECTION" ]; then
source $BIN_DIR/steps/django/injection source $BIN_DIR/steps/django/injection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment