mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
25 lines
781 B
Bash
Executable File
25 lines
781 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set +e
|
|
|
|
# Check if collectstatic is configured.
|
|
python $MANAGE_FILE collectstatic --help &> /dev/null && RUN_COLLECTSTATIC=true
|
|
|
|
# Don't raise errors if SILENCE_COLLECTSTATIC is set.
|
|
if [ ! "$SILENCE_COLLECTSTATIC" ]; then
|
|
set -e
|
|
fi
|
|
|
|
# Compile assets if collectstatic appears to be kosher.
|
|
if [ "$RUN_COLLECTSTATIC" ]; then
|
|
echo "-----> Collecting static files"
|
|
python $MANAGE_FILE collectstatic --noinput --verbosity=0 | indent
|
|
|
|
[ $? -ne 0 ] && {
|
|
echo " ! Error running manage.py collectstatic. More info:"
|
|
echo " http://devcenter.heroku.com/articles/django-assets"
|
|
}
|
|
else
|
|
echo " ! Django collecstatic is not configured. Learn more:"
|
|
echo " http://devcenter.heroku.com/articles/django-assets"
|
|
fi |