Skip to content

Commit a21dbc2

Browse files
author
Kenneth Reitz
committed
run collectstatic
1 parent cf5a9d2 commit a21dbc2

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

bin/steps/django/collectstatic

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22

33
set +e
44

5-
# Compile assets.
6-
echo "-----> Collecting static files"
7-
python $PROJECT/manage.py collectstatic --noinput | indent
5+
# Check if collectstatic is configured.
6+
python $PROJECT/manage.py collectstatic --help &> /dev/null && RUN_COLLECTSTATIC=true
87

9-
[ $? -ne 0 ] && {
10-
echo " ! Error running manage.py collectstatic. More info:"
11-
echo " ! http://devcenter.heroku.com/articles/django-assets"
12-
}
8+
# Don't raise errors if SILENCE_COLLECTSTATIC is set.
9+
if [ ! "$SILENCE_COLLECTSTATIC" ]]; then
10+
set -e
11+
fi
12+
13+
# Compile assets if collectstatic appears to be .
14+
if [ "$RUN_COLLECTSTATIC" ]; then
15+
echo "-----> Collecting static files"
16+
python $PROJECT/manage.py collectstatic --noinput | indent
17+
18+
[ $? -ne 0 ] && {
19+
echo " ! Error running manage.py collectstatic. More info:"
20+
echo " http://devcenter.heroku.com/articles/django-assets"
21+
}
22+
else
23+
echo " ! Django collecstatic is not configured. Learn more:"
24+
echo " http://devcenter.heroku.com/articles/django-assets"
25+
fi
1326

14-
set -e

0 commit comments

Comments
 (0)