1
0
mirror of https://github.com/limosek/zaf.git synced 2024-11-21 18:09:06 +01:00

When cache is in tmp, automaticaly create it

This commit is contained in:
Lukas Macura 2016-11-22 14:03:27 +01:00
parent 006a9fc99b
commit cc244ef791

View File

@ -1,7 +1,11 @@
# Zaf cache related functions # Zaf cache related functions
zaf_cache_init(){ 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 if [ -w $ZAF_CACHE_DIR ]; then
zaf_trc "Cache: Removing stale entries" zaf_trc "Cache: Removing stale entries"
(cd $ZAF_CACHE_DIR && find ./ -type f -name '*.info' -mmin +1 2>/dev/null | \ (cd $ZAF_CACHE_DIR && find ./ -type f -name '*.info' -mmin +1 2>/dev/null | \