Bugfix: add cache suffix later

This commit is contained in:
Reid 'arrdem' McKenzie 2022-11-28 19:41:28 -07:00
parent ca333bf74c
commit 22a12ae817

View file

@ -16,11 +16,11 @@ from .common import Package, sh, stow, expandvars
def tempf(global_config, name):
root = Path(global_config["cram"]["root"]) / ".cache" # Config root dir.
root = Path(global_config["cram"]["root"])
assert root.exists() and root.is_dir()
cache_dir = global_config.get("cram", {}).get("task", {}).get("default", {}).get("cache_dir")
cache_root = cache_dir and Path(expandvars(cache_dir)) or root
cache_root = cache_dir and Path(expandvars(cache_dir)) or root / ".cache"
return cache_root / name[0:2] / name