From cc244ef7913e7c092d0bc83ec8ed21808991be7d Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Tue, 22 Nov 2016 14:03:27 +0100 Subject: [PATCH] When cache is in tmp, automaticaly create it --- lib/cache.lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cache.lib.sh b/lib/cache.lib.sh index 5156d6e..380c7ec 100644 --- a/lib/cache.lib.sh +++ b/lib/cache.lib.sh @@ -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 | \