Skip to content
Snippets Groups Projects
Commit 5ea84345 authored by Kenneth Reitz's avatar Kenneth Reitz
Browse files

improved collectstatic experience

parent 2c165391
No related branches found
No related tags found
No related merge requests found
...@@ -10,19 +10,23 @@ MANAGE_FILE=${MANAGE_FILE:-fakepath} ...@@ -10,19 +10,23 @@ MANAGE_FILE=${MANAGE_FILE:-fakepath}
if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ]; then if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ]; then
set +e set +e
echo "-----> Preparing static assets"
# Check if collectstatic is configured properly. # Check if collectstatic is configured properly.
python $MANAGE_FILE collectstatic --dry-run --noinput &> /dev/null && RUN_COLLECTSTATIC=true python $MANAGE_FILE collectstatic --dry-run --noinput &> /dev/null && RUN_COLLECTSTATIC=true
# Compile assets if collectstatic appears to be kosher. # Compile assets if collectstatic appears to be kosher.
if [ "$RUN_COLLECTSTATIC" ]; then if [ "$RUN_COLLECTSTATIC" ]; then
echo "-----> Collecting static files" echo " Running collectstatic..."
python $MANAGE_FILE collectstatic --noinput 2>&1 | sed '/^Copying/d;/^$/d;/^ /d' | indent python $MANAGE_FILE collectstatic --noinput 2>&1 | sed '/^Copying/d;/^$/d;/^ /d' | indent
[ $? -ne 0 ] && { [ $? -ne 0 ] && {
echo " ! Error running manage.py collectstatic. More info:" echo " ! Error running 'manage.py collectstatic'. More info:"
echo " http://devcenter.heroku.com/articles/django-assets" echo " http://devcenter.heroku.com/articles/django-assets"
} }
else
echo " ! Error running 'manage.py collectstatic --dry-run'. More info:"
echo " http://devcenter.heroku.com/articles/django-assets"
fi fi
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment