Documentation
¶
Overview ¶
Package config loads Critty configuration from the XDG config directory (global) and the project root (.critty.config.json), mirroring crit's two-level merge semantics for the subset of keys Critty supports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProjectPath ¶
ProjectPath returns the project config file path under root.
Types ¶
type Config ¶
type Config struct {
Output string `json:"output,omitempty"`
Author string `json:"author,omitempty"`
IgnorePatterns []string `json:"ignore_patterns,omitempty"`
Launchers []string `json:"launchers,omitempty"`
Quiet bool `json:"quiet,omitempty"`
CleanupOnApprove bool `json:"cleanup_on_approve,omitempty"`
DisableStats bool `json:"disable_stats,omitempty"`
Prompts map[string]string `json:"prompts,omitempty"`
// ProjectRoot is the directory the project-level config was resolved
// against (git top level or cwd). Not part of the file format.
ProjectRoot string `json:"-"`
}
Config is the resolved (merged) configuration.
func Load ¶
Load merges global and project configuration. Each level falls back to its legacy path only when the current file is absent. projectRoot may be empty to skip the project level. Missing files are not errors.
func LoadCurrent ¶
LoadCurrent loads configuration for the current directory, using the git top-level directory as the project root when inside a repository.