Documentation
¶
Overview ¶
Package workdir resolves the td database root directory, supporting git worktree redirection via .td-root files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadAssociations ¶ added in v0.36.0
LoadAssociations reads the directory associations from ~/.config/td/associations.json. Returns an empty map if the file does not exist.
func LookupAssociation ¶ added in v0.36.0
LookupAssociation checks if dir has a directory association configured. Returns the target path and true if found, empty string and false otherwise.
func ResolveBaseDir ¶
ResolveBaseDir resolves td's project root with conservative heuristics:
- Honor .td-root in the current directory.
- Use current directory if it already has a .todos directory.
- If inside git, check git root for .td-root or .todos.
If no td markers are found, it returns the original baseDir unchanged.
func SaveAssociations ¶ added in v0.36.0
SaveAssociations writes the directory associations to ~/.config/td/associations.json using atomic write.
Types ¶
This section is empty.