Documentation
¶
Overview ¶
Package packs provides functionality for discovering, loading, and managing dotfile packs within the dodot system.
A pack is a directory containing dotfiles and optional configuration that defines how those files should be deployed. This package handles:
- Pack discovery and validation
- Pack configuration loading (.dodot.toml files)
- Pack ignore functionality (.dodotignore files)
- Pack filtering and selection
The package implements the core pack management logic that feeds into the dodot deployment pipeline.
Index ¶
- func GetPackCandidates(dotfilesRoot string) ([]string, error)
- func GetPackCandidatesFS(dotfilesRoot string, filesystem types.FS) ([]string, error)
- func GetPackNames(packs []types.Pack) []string
- func GetPacks(candidates []string) ([]types.Pack, error)
- func GetPacksFS(candidates []string, filesystem types.FS) ([]types.Pack, error)
- func LoadPackConfig(configPath string) (config.PackConfig, error)
- func NormalizePackName(name string) string
- func NormalizePackNames(names []string) []string
- func SelectPacks(allPacks []types.Pack, selectedNames []string) ([]types.Pack, error)
- func ShouldIgnoreDirectoryTraversal(dirPath string, relPath string) bool
- func ShouldIgnorePack(packPath string) bool
- func ShouldIgnorePackFS(packPath string, filesystem types.FS) bool
- func ValidatePack(packPath string) error
- type IgnoreChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPackCandidates ¶
GetPackCandidates returns all potential pack directories in the dotfiles root Deprecated: Use GetPackCandidatesFS instead to support filesystem abstraction
IMPORTANT: Commands should NOT call this function directly. Instead, use the centralized helper core.DiscoverAndSelectPacks which properly handles pack discovery, loading, and selection in a consistent way.
func GetPackCandidatesFS ¶ added in v0.1.4
GetPackCandidatesFS returns all potential pack directories using the provided filesystem
IMPORTANT: Commands should NOT call this function directly. Instead, use the centralized helper core.DiscoverAndSelectPacks which properly handles pack discovery, loading, and selection in a consistent way.
func GetPackNames ¶
GetPackNames returns a list of pack names
func GetPacks ¶
GetPacks validates and creates Pack instances from candidate paths Deprecated: Use GetPacksFS instead to support filesystem abstraction
IMPORTANT: Commands should NOT call this function directly. Instead, use the centralized helper core.DiscoverAndSelectPacks which properly handles pack discovery, loading, and selection in a consistent way.
func GetPacksFS ¶ added in v0.1.4
GetPacksFS validates and creates Pack instances from candidate paths using the provided filesystem
IMPORTANT: Commands should NOT call this function directly. Instead, use the centralized helper core.DiscoverAndSelectPacks which properly handles pack discovery, loading, and selection in a consistent way.
func LoadPackConfig ¶
func LoadPackConfig(configPath string) (config.PackConfig, error)
LoadPackConfig reads and parses a pack's .dodot.toml configuration file
func NormalizePackName ¶ added in v0.3.0
NormalizePackName removes trailing slashes from a pack name. This handles cases where shell completion adds a trailing slash to directory names.
func NormalizePackNames ¶ added in v0.3.0
NormalizePackNames removes trailing slashes from all pack names in the slice.
func SelectPacks ¶
SelectPacks filters a list of packs by name
IMPORTANT: Commands should NOT call this function directly. Instead, use the centralized helper core.DiscoverAndSelectPacks which properly handles pack discovery, loading, and selection in a consistent way.
func ShouldIgnoreDirectoryTraversal ¶
ShouldIgnoreDirectoryTraversal checks if a directory should be skipped during traversal This function provides a convenient interface for file walking operations
func ShouldIgnorePack ¶
ShouldIgnorePack checks if a pack should be ignored by checking for a .dodotignore file This function maintains backward compatibility with existing code
func ShouldIgnorePackFS ¶ added in v0.1.4
ShouldIgnorePackFS checks if a pack should be ignored using the provided filesystem
func ValidatePack ¶
ValidatePack checks if a directory is a valid pack
Types ¶
type IgnoreChecker ¶
type IgnoreChecker struct {
// contains filtered or unexported fields
}
IgnoreChecker provides unified interface for checking if packs or files should be ignored
func NewIgnoreChecker ¶
func NewIgnoreChecker() *IgnoreChecker
NewIgnoreChecker creates a new IgnoreChecker instance
func (*IgnoreChecker) HasIgnoreFile ¶
func (ic *IgnoreChecker) HasIgnoreFile(dirPath string) bool
HasIgnoreFile checks if a directory contains a .dodotignore file
func (*IgnoreChecker) ShouldIgnoreDirectoryDuringTraversal ¶
func (ic *IgnoreChecker) ShouldIgnoreDirectoryDuringTraversal(dirPath string, relPath string) bool
ShouldIgnoreDirectoryDuringTraversal checks if a directory should be skipped during file traversal This is used when walking through pack contents to find files
func (*IgnoreChecker) ShouldIgnorePackDirectory ¶
func (ic *IgnoreChecker) ShouldIgnorePackDirectory(packPath string) bool
ShouldIgnorePackDirectory checks if a pack directory should be ignored due to .dodotignore file
Directories
¶
| Path | Synopsis |
|---|---|
|
Package commands provides Command implementations for the pack orchestration.
|
Package commands provides Command implementations for the pack orchestration. |
|
Package orchestration provides orchestration for executing commands across multiple packs.
|
Package orchestration provides orchestration for executing commands across multiple packs. |