2023-11-15 13:28:40 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
2023-10-24 14:54:10 +00:00
|
|
|
from ..dirs import specific_machine_dir
|
2023-09-19 19:48:39 +00:00
|
|
|
|
|
|
|
|
2023-11-15 13:28:40 +00:00
|
|
|
def machine_has_fact(flake_dir: Path, machine: str, fact: str) -> bool:
|
|
|
|
return (specific_machine_dir(flake_dir, machine) / "facts" / fact).exists()
|
2023-09-19 19:48:39 +00:00
|
|
|
|
|
|
|
|
2023-11-15 13:28:40 +00:00
|
|
|
def machine_get_fact(flake_dir: Path, machine: str, fact: str) -> str:
|
|
|
|
return (specific_machine_dir(flake_dir, machine) / "facts" / fact).read_text()
|