Skip to content
Snippets Groups Projects
Commit 087f4f8b authored by alvaro's avatar alvaro
Browse files

When asked to clear cache, delete all data from sqlite, EXCEPT when turning debug mode on/off

parent 0ad39ee6
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,7 @@ if [[ $currentOperation == "debug" ]]; then ...@@ -85,7 +85,7 @@ if [[ $currentOperation == "debug" ]]; then
exit 1 exit 1
fi fi
php $DIR/modules/debug.php "$debugOperation" php $DIR/modules/debug.php "$debugOperation"
$DIR/modules/cache.sh clear $DIR/modules/cache.sh clear nometa
exit exit
fi fi
......
...@@ -3,10 +3,13 @@ ...@@ -3,10 +3,13 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cacheDir=$DIR/../../cache cacheDir=$DIR/../../cache
metaDir=$DIR/../../meta
if [[ $1 == "clear" ]]; then if [[ $1 == "clear" ]]; then
if [ -d "$cacheDir" ]; then if [ -d "$cacheDir" ]; then
rm -f $cacheDir/* rm -f $cacheDir/*
if [[ $2 != "nometa" ]]; then
sqlite3 $metaDir/db.sqlite 'delete from document'
fi
else else
echo "ERROR: Couldn't find cache directory" >&2 echo "ERROR: Couldn't find cache directory" >&2
exit 1 exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment