Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStaleGlobalConfig = errors.New("stale global config entry")
ErrStaleGlobalConfig indicates the global config references a project path but the kan data directory doesn't exist. This can happen if the user manually deletes the .kan/ directory.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
ProjectRoot string // Absolute path to project root
DataLocation string // Relative path for kan data (empty = default .kan/)
WasRegistered bool // Whether this project was found in global config
}
Result contains the discovered project root and data location.
func DiscoverProject ¶
func DiscoverProject(globalCfg *model.GlobalConfig) (*Result, error)
DiscoverProject finds the project root by walking up from cwd. Priority: 1. Directory that's a key in global config -> use configured DataLocation 2. Directory containing .kan/ -> use as self-discoverable default
Returns nil if no project found (not initialized). Returns error if global config references a path but data is missing.
func DiscoverProjectFrom ¶
func DiscoverProjectFrom(startDir string, globalCfg *model.GlobalConfig) (*Result, error)
DiscoverProjectFrom finds the project root starting from a given directory.