Documentation
¶
Overview ¶
Package tdroot provides utilities for resolving td's root directory and database paths. It handles the .td-root file mechanism used to share a td database across git worktrees.
Index ¶
Constants ¶
const ( // TDRootFile is the filename used to link a worktree to a shared td root. TDRootFile = ".td-root" // TodosDir is the directory containing td's database and related files. TodosDir = ".todos" // DBFile is the filename of td's SQLite database. DBFile = "issues.db" )
Variables ¶
var ErrTodosIsFile = errors.New("found .todos file where a directory is expected")
ErrTodosIsFile is returned when .todos exists as a file instead of a directory.
Functions ¶
func CheckTodosConflict ¶ added in v0.75.0
CheckTodosConflict checks whether a .todos path exists as a regular file instead of a directory. This can happen when an AI agent or other tool creates a .todos file, conflicting with td's expected .todos directory. Returns ErrTodosIsFile if there's a conflict, nil otherwise.
func CreateTDRoot ¶
CreateTDRoot writes a td-root file to the centralized project directory pointing to targetRoot. Used when creating worktrees to share the td database.
func ResolveDBPath ¶
ResolveDBPath returns the full path to the td database. Uses .td-root resolution to find the correct database location.
func ResolveTDRoot ¶
ResolveTDRoot reads .td-root file and returns the resolved root path. Returns workDir if no .td-root exists or it's empty.
Types ¶
This section is empty.