From b0568b5f90628b4bd60b72ad907baf9a8ad7bc85 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz <me@kennethreitz.org> Date: Thu, 4 Feb 2016 23:25:41 -0500 Subject: [PATCH] PIPESTATUS --- bin/steps/collectstatic | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/steps/collectstatic b/bin/steps/collectstatic index c2856d8b..fea3258c 100755 --- a/bin/steps/collectstatic +++ b/bin/steps/collectstatic @@ -31,9 +31,12 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALL # Run collectstatic, cleanup some of the noisy output. python $MANAGE_FILE collectstatic --noinput 2>&1 | sed '/^Copying/d;/^$/d;/^ /d' | indent + COLLECTSTATIC_STATUS="${PIPESTATUS[0]}" + + set -e # Display a warning if collectstatic failed. - [ $? -ne 0 ] && { + [ $COLLECTSTATIC_STATUS -ne 0 ] && { echo " ! Error while runnning '$ python $MANAGE_FILE collectstatic --noinput'." echo " See traceback above for more details." echo " More info: http://devcenter.heroku.com/articles/django-assets" @@ -50,7 +53,6 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALL exit 1 } - set -e echo fi -- GitLab