Commit b8052d838454265ac65f17ea95e06e96f7c0b66e

Authored by Joenio Costa
1 parent ab40efca

Clear cache files even with Noosfero installed via Debian package

Showing 2 changed files with 10 additions and 0 deletions   Show diff stats
debian/default/noosfero
1 1 NOOSFERO_DIR="/usr/share/noosfero"
2 2 NOOSFERO_USER="noosfero"
  3 +NOOSFERO_DATA_DIR="/var/lib/noosfero-data"
... ...
script/production
... ... @@ -2,6 +2,10 @@
2 2  
3 3 set -e
4 4  
  5 +if [ -e /etc/default/noosfero ]; then
  6 + . /etc/default/noosfero
  7 +fi
  8 +
5 9 export RAILS_ENV=production
6 10  
7 11 ACTION=$1
... ... @@ -9,8 +13,13 @@ shift
9 13  
10 14 clear_cache() {
11 15 if test -w ./public; then
  16 + echo "Cleaning cache files"
12 17 rm -f ./public/javascripts/cache-*.js
13 18 rm -f ./public/stylesheets/cache.css
  19 + elif [ ! -z "$NOOSFERO_DATA_DIR" ] && [ -w "$NOOSFERO_DATA_DIR" ]; then
  20 + echo "Cleaning cache files"
  21 + rm -f $NOOSFERO_DATA_DIR/cache/cache-*.js
  22 + rm -f $NOOSFERO_DATA_DIR/cache/cache.css
14 23 fi
15 24 }
16 25  
... ...