check that the cache_path ends with /

This commit is contained in:
Ploum 2024-01-23 21:21:15 +01:00
parent 87837fd1fb
commit 0a9fb62582
2 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@
## 2.2 - Unpublished
- cache folder is now configurable through $OFFPUNK_CACHE_PATH environment variable (by prx)
- offpunk: adding an URL to a list now update the view mode if url already present
- netcache: solve an infinite gemini loop with code 6X (see also bug #31)
- ansicat: added support for <video> HTML-element

View File

@ -68,6 +68,9 @@ def xdg(folder="cache"):
os.path.join(_home,'.cache')
_CACHE_PATH = os.environ.get('OFFPUNK_CACHE_PATH', \
os.path.join(os.path.expanduser(cache_home),"offpunk/"))
#Check that the cache path ends with "/"
if not _CACHE_PATH.endswith("/"):
_CACHE_PATH += "/"
os.makedirs(_CACHE_PATH,exist_ok=True)
if folder == "cache" and not UPGRADED:
upgrade_cache(_CACHE_PATH)