Files
clan-core/pkgs/clan-cli/clan_cli/machines/facts.py
Jörg Thalheim b313f2d066 make all same-module imports relative, the rest absolute
This makes sorting more consitent.
2024-09-02 13:00:19 +02:00

12 lines
383 B
Python

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