pub struct ConfigManager { /* private fields */ }Expand description
Manages configuration loading and per-pack resolution.
Wraps clapfig’s Resolver to provide cached, merged config
resolution. Call config_for_pack
for each pack — the root .dodot.toml is read once and cached.
Implementations§
Source§impl ConfigManager
impl ConfigManager
Sourcepub fn new(dotfiles_root: &Path) -> Result<Self>
pub fn new(dotfiles_root: &Path) -> Result<Self>
Create a new config manager for the given dotfiles root.
Builds a clapfig Resolver that searches for .dodot.toml files
using ancestor-walk from the resolve point up to (and including)
the dotfiles root, identified by its .git directory. This
prevents stray .dodot.toml files above the repo from leaking in.
Sourcepub fn root_config(&self) -> Result<DodotConfig>
pub fn root_config(&self) -> Result<DodotConfig>
Load the root-level configuration (no pack override).
Sourcepub fn config_for_pack(&self, pack_path: &Path) -> Result<DodotConfig>
pub fn config_for_pack(&self, pack_path: &Path) -> Result<DodotConfig>
Load merged configuration for a specific pack.
Resolves by walking from pack_path up through ancestors,
merging any .dodot.toml files found along the way (including
the root config). Results are cached by absolute path.