Files
clan-core/pkgs/clan-cli/clan_cli/machines/facts.py
2023-10-27 19:15:11 +02:00

10 lines
352 B
Python

from ..dirs import specific_machine_dir
def machine_has_fact(flake_name: str, machine: str, fact: str) -> bool:
return (specific_machine_dir(flake_name, machine) / "facts" / fact).exists()
def machine_get_fact(flake_name: str, machine: str, fact: str) -> str:
return (specific_machine_dir(flake_name, machine) / "facts" / fact).read_text()