From b8052d838454265ac65f17ea95e06e96f7c0b66e Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Thu, 13 Oct 2011 10:16:43 -0300 Subject: [PATCH] Clear cache files even with Noosfero installed via Debian package --- debian/default/noosfero | 1 + script/production | 9 +++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/debian/default/noosfero b/debian/default/noosfero index 4a314e4..92a4b44 100644 --- a/debian/default/noosfero +++ b/debian/default/noosfero @@ -1,2 +1,3 @@ NOOSFERO_DIR="/usr/share/noosfero" NOOSFERO_USER="noosfero" +NOOSFERO_DATA_DIR="/var/lib/noosfero-data" diff --git a/script/production b/script/production index f5f85c3..bdf709e 100755 --- a/script/production +++ b/script/production @@ -2,6 +2,10 @@ set -e +if [ -e /etc/default/noosfero ]; then + . /etc/default/noosfero +fi + export RAILS_ENV=production ACTION=$1 @@ -9,8 +13,13 @@ shift clear_cache() { if test -w ./public; then + echo "Cleaning cache files" rm -f ./public/javascripts/cache-*.js rm -f ./public/stylesheets/cache.css + elif [ ! -z "$NOOSFERO_DATA_DIR" ] && [ -w "$NOOSFERO_DATA_DIR" ]; then + echo "Cleaning cache files" + rm -f $NOOSFERO_DATA_DIR/cache/cache-*.js + rm -f $NOOSFERO_DATA_DIR/cache/cache.css fi } -- libgit2 0.21.2