tdroot

package
v0.75.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 6 Imported by: 0

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

View Source
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

View Source
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

func CheckTodosConflict(workDir string) error

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

func CreateTDRoot(projectRoot, worktreePath, targetRoot string) error

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

func ResolveDBPath(workDir string) string

ResolveDBPath returns the full path to the td database. Uses .td-root resolution to find the correct database location.

func ResolveTDRoot

func ResolveTDRoot(workDir string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL