Home
home
Home directory resolution and in-repo path guard.
axm_home() returns the resolved ~/.axm directory, creating it with
mode 0700 (idempotent, tightening looser pre-existing perms). resolve_safe
is the security primitive the vault relies on: it refuses any path that resolves
inside a git repository / source checkout, so a 0600 secrets/config file can
never land in a repo.
Pure stdlib only (pathlib, os, stat); no third-party import.
axm_home()
Return the resolved ~/.axm directory, creating it 0700 if absent.
Idempotent: a pre-existing directory with looser permissions is tightened
back to 0700. Permission calls degrade gracefully on non-POSIX systems.
Source code in packages/axm-config/src/axm_config/home.py
resolve_safe(target)
Resolve target and refuse any path sitting inside a git repo.
Walks the resolved path and its ancestors looking for a .git marker
(a source checkout). Raises :class:ValueError rather than returning an
in-repo path; returns the resolved path otherwise.