packs

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 10 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPackCandidates

func GetPackCandidates(dotfilesRoot string) ([]string, error)

GetPackCandidates returns all potential pack directories in the dotfiles root

func GetPackNames

func GetPackNames(packs []types.Pack) []string

GetPackNames returns a list of pack names

func GetPacks

func GetPacks(candidates []string) ([]types.Pack, error)

GetPacks validates and creates Pack instances from candidate paths

func LoadPackConfig

func LoadPackConfig(configPath string) (types.PackConfig, error)

LoadPackConfig reads and parses a pack's .dodot.toml configuration file

func SelectPacks

func SelectPacks(allPacks []types.Pack, selectedNames []string) ([]types.Pack, error)

SelectPacks filters a list of packs by name

func ShouldIgnoreDirectoryTraversal

func ShouldIgnoreDirectoryTraversal(dirPath string, relPath string) bool

ShouldIgnoreDirectoryTraversal checks if a directory should be skipped during traversal This function provides a convenient interface for file walking operations

func ShouldIgnorePack

func ShouldIgnorePack(packPath string) bool

ShouldIgnorePack checks if a pack should be ignored by checking for a .dodotignore file This function maintains backward compatibility with existing code

func ValidatePack

func ValidatePack(packPath string) error

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

Jump to

Keyboard shortcuts

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