move flake configuration to .config/clan/flakes rather than $XDG_DATA_DIRS
All checks were successful
checks-impure / test (pull_request) Successful in 1m34s
checks / test (pull_request) Successful in 2m31s

This commit is contained in:
Jörg Thalheim 2023-11-10 12:50:11 +01:00
parent 46191b9a9c
commit df1acebd87
3 changed files with 3 additions and 2 deletions

View File

@ -68,7 +68,7 @@ def clan_config_dir() -> Path:
def clan_flakes_dir() -> Path:
path = clan_data_dir() / "flake"
path = clan_config_dir() / "flakes"
if not path.exists():
log.debug(f"Creating path with parents {path}")
path.mkdir(parents=True)

View File

@ -55,7 +55,7 @@ def create_flake(
template = Path(__file__).parent / flake_name
# copy the template to a new temporary location
flake = temporary_home / ".local/share/clan/flake" / flake_name
flake = temporary_home / ".config/clan/flakes" / flake_name
shutil.copytree(template, flake)
# lookup the requested machines in ./test_machines and include them

View File

@ -21,6 +21,7 @@ def temporary_home(monkeypatch: pytest.MonkeyPatch) -> Iterator[Path]:
else:
with tempfile.TemporaryDirectory(prefix="pytest-") as dirpath:
monkeypatch.setenv("HOME", str(dirpath))
monkeypatch.setenv("XDG_CONFIG_HOME", str(Path(dirpath) / ".config"))
monkeypatch.setenv("XDG_DATA_HOME", str(Path(dirpath) / ".local/share"))
monkeypatch.chdir(str(dirpath))
log.debug("Temp HOME directory: %s", str(dirpath))