Documentation
¶
Overview ¶
Package adopt provides interactive file adoption.
This file contains discovery logic for the interactive adopt workflow that is tightly coupled to the interactive UI and filesystem operations. It is excluded from coverage requirements as it requires integration testing.
Package adopt provides interactive file adoption.
This file contains interactive workflow logic that is tightly coupled to Bubble Tea UI components and cannot be reliably unit tested. It is excluded from coverage requirements.
Package adopt provides interactive file adoption.
This file contains Bubble Tea UI code which is excluded from coverage requirements as interactive terminal UI cannot be reliably unit tested.
Package adopt provides interactive file adoption.
This file contains Bubble Tea UI code which is excluded from coverage requirements as interactive terminal UI cannot be reliably unit tested.
Package adopt provides interactive adoption functionality.
Index ¶
- func AppendToGlobalDotignore(ctx context.Context, fs domain.FS, configDir, pattern string) error
- func DefaultExcludeDirs() []string
- func DefaultScanDirs(homeDir string) []string
- func GroupByCategory(candidates []DotfileCandidate, selections []int) map[string][]DotfileCandidate
- type AdoptGroup
- type ArrowSelector
- type DiscoveryOptions
- type DotfileCandidate
- type InteractiveAdopter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToGlobalDotignore ¶
AppendToGlobalDotignore appends a pattern to the global .dotignore file. Creates the file if it doesn't exist. Returns error if operation fails.
func DefaultExcludeDirs ¶
func DefaultExcludeDirs() []string
DefaultExcludeDirs returns commonly excluded directories.
func DefaultScanDirs ¶
DefaultScanDirs returns the default directories to scan for dotfiles.
func GroupByCategory ¶
func GroupByCategory(candidates []DotfileCandidate, selections []int) map[string][]DotfileCandidate
GroupByCategory groups candidates by their suggested package names. Provides intelligent defaults but user can override.
Types ¶
type AdoptGroup ¶
type AdoptGroup struct {
PackageName string // Package name to adopt into
Files []string // Absolute paths of files to adopt
Category string // Category of the group
}
AdoptGroup represents a logical grouping of files for adoption.
type ArrowSelector ¶
type ArrowSelector struct {
// contains filtered or unexported fields
}
ArrowSelector provides an arrow-key based multi-select interface.
func NewArrowSelector ¶
func NewArrowSelector(input io.Reader, output io.Writer, fs domain.FS, configDir string) *ArrowSelector
NewArrowSelector creates a new arrow-key selector.
func (*ArrowSelector) SelectMultiple ¶
func (s *ArrowSelector) SelectMultiple(items []string, candidates []DotfileCandidate) ([]int, error)
SelectMultiple displays items and allows arrow key navigation with spacebar to toggle selection. Returns indices of selected items.
type DiscoveryOptions ¶
type DiscoveryOptions struct {
ScanDirs []string // Directories to scan
ExcludeDirs []string // Directories to exclude
MaxFileSize int64 // Maximum file size (0 = no limit)
IgnorePatterns []string // Additional ignore patterns
}
DiscoveryOptions configures dotfile discovery.
type DotfileCandidate ¶
type DotfileCandidate struct {
Path string // Absolute path
RelPath string // Path relative to scan root (for display)
Size int64 // File size in bytes
ModTime time.Time // Last modification time
IsDir bool // True if directory
Category string // Categorization hint: "shell", "git", "vim", etc.
SuggestedPkg string // Suggested package name
}
DotfileCandidate represents a file discovered for potential adoption.
func DiscoverDotfiles ¶
func DiscoverDotfiles( ctx context.Context, fs domain.FS, opts DiscoveryOptions, client *dot.Client, targetDir string, ) ([]DotfileCandidate, error)
DiscoverDotfiles scans directories for adoptable dotfiles. Returns candidates excluding already-managed files.
func ScanWithProgress ¶
func ScanWithProgress( ctx context.Context, fs domain.FS, opts DiscoveryOptions, client *dot.Client, targetDir string, ) ([]DotfileCandidate, error)
ScanWithProgress runs the discovery with a progress spinner.
type InteractiveAdopter ¶
type InteractiveAdopter struct {
// contains filtered or unexported fields
}
InteractiveAdopter manages the interactive adoption workflow.
func NewInteractiveAdopter ¶
func NewInteractiveAdopter(input io.Reader, output io.Writer, colorize bool, fs domain.FS, configDir string) *InteractiveAdopter
NewInteractiveAdopter creates a new interactive adopter.
func (*InteractiveAdopter) Run ¶
func (ia *InteractiveAdopter) Run(ctx context.Context, candidates []DotfileCandidate) ([]AdoptGroup, error)
Run executes the interactive adoption workflow. Returns selected groups ready for adoption.