mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
b622fe8f19
Implement the `FileProvider` interface, this allows pipes to request files given a `FileRequest` (hash and optional size/name).
16 lines
335 B
Python
16 lines
335 B
Python
#
|
|
# This file is distributed under the MIT License. See LICENSE.md for details.
|
|
#
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
from xdg import xdg_cache_home
|
|
|
|
|
|
def cache_directory() -> Path:
|
|
if "PYPELINE_CACHE_DIR" in os.environ:
|
|
return Path(os.environ["PYPELINE_CACHE_DIR"])
|
|
else:
|
|
return xdg_cache_home() / "pypeline"
|