mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
a5cca6de75
In `bin/steps/collectstatic` the unbuffered output in `indent` is subverted by calling `sed` first: ```shell python $MANAGE_FILE collectstatic --noinput 2>&1 | sed '/^Copying/d;/^$/d;/^ /d' | indent ``` This commit fixes this by making `sed` itself unbuffered rather than putting that logic in the `indent` function.
33 lines
903 B
Bash
Executable File
33 lines
903 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
source $BIN_DIR/utils
|
|
|
|
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1)
|
|
MANAGE_FILE=${MANAGE_FILE:-fakepath}
|
|
|
|
[ -f .heroku/collectstatic_disabled ] && DISABLE_COLLECTSTATIC=1
|
|
|
|
if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ]; then
|
|
set +e
|
|
|
|
# Check if collectstatic is configured properly.
|
|
python $MANAGE_FILE collectstatic --dry-run --noinput &> /dev/null && RUN_COLLECTSTATIC=true
|
|
|
|
# Compile assets if collectstatic appears to be kosher.
|
|
if [ "$RUN_COLLECTSTATIC" ]; then
|
|
|
|
echo "-----> Collecting static files"
|
|
python $MANAGE_FILE collectstatic --noinput 2>&1 | sed '/^Copying/d;/^$/d;/^ /d' | indent
|
|
|
|
[ $? -ne 0 ] && {
|
|
echo " ! Error running manage.py collectstatic. More info:"
|
|
echo " http://devcenter.heroku.com/articles/django-assets"
|
|
}
|
|
fi
|
|
|
|
echo
|
|
|
|
|
|
fi
|
|
|