move flake configuration to .config/clan/flakes rather than $XDG_DATA_DIRS
This commit is contained in:
@@ -68,7 +68,7 @@ def clan_config_dir() -> Path:
|
|||||||
|
|
||||||
|
|
||||||
def clan_flakes_dir() -> Path:
|
def clan_flakes_dir() -> Path:
|
||||||
path = clan_data_dir() / "flake"
|
path = clan_config_dir() / "flakes"
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
log.debug(f"Creating path with parents {path}")
|
log.debug(f"Creating path with parents {path}")
|
||||||
path.mkdir(parents=True)
|
path.mkdir(parents=True)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ def create_flake(
|
|||||||
template = Path(__file__).parent / flake_name
|
template = Path(__file__).parent / flake_name
|
||||||
|
|
||||||
# copy the template to a new temporary location
|
# 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)
|
shutil.copytree(template, flake)
|
||||||
|
|
||||||
# lookup the requested machines in ./test_machines and include them
|
# lookup the requested machines in ./test_machines and include them
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ def temporary_home(monkeypatch: pytest.MonkeyPatch) -> Iterator[Path]:
|
|||||||
else:
|
else:
|
||||||
with tempfile.TemporaryDirectory(prefix="pytest-") as dirpath:
|
with tempfile.TemporaryDirectory(prefix="pytest-") as dirpath:
|
||||||
monkeypatch.setenv("HOME", str(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.setenv("XDG_DATA_HOME", str(Path(dirpath) / ".local/share"))
|
||||||
monkeypatch.chdir(str(dirpath))
|
monkeypatch.chdir(str(dirpath))
|
||||||
log.debug("Temp HOME directory: %s", str(dirpath))
|
log.debug("Temp HOME directory: %s", str(dirpath))
|
||||||
|
|||||||
Reference in New Issue
Block a user