When cache is in tmp, automaticaly create it

1.3
Lukas Macura 2016-11-22 14:03:27 +01:00
parent 006a9fc99b
commit cc244ef791
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,11 @@
# Zaf cache related functions
zaf_cache_init(){
[ -z "$ZAF_CACHE_DIR" ] && ZAF_CACHE_DIR=${ZAF_TMP_DIR}/zafc
if [ -z "$ZAF_CACHE_DIR" ] || [ "$ZAF_CACHE_DIR" = "/tmp/zafc" ]; then
ZAF_CACHE_DIR=${ZAF_TMP_DIR}/zafc
mkdir -p $ZAF_CACHE_DIR
chown $ZAF_FILES_UID $ZAF_CACHE_DIR
fi
if [ -w $ZAF_CACHE_DIR ]; then
zaf_trc "Cache: Removing stale entries"
(cd $ZAF_CACHE_DIR && find ./ -type f -name '*.info' -mmin +1 2>/dev/null | \