dotfile

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransformPath

func TransformPath(home, repo string, p string) (string, error)

TransformPath transforms a home-relative dotfile path to a repo path. ~/.zshrc -> <repo>/dot_zshrc ~/.config/nvim/init.lua -> <repo>/dot_config/nvim/init.lua

Types

type Pair

type Pair struct {
	Src string
	Dst string
}

Pair is a source→destination file mapping.

func Collect

func Collect(dir, homeDir string, skipProfiles bool) ([]Pair, error)

Collect walks dir recursively and returns Pairs mapping src→dst. Only files whose top-level path segment starts with dot_ are collected. The .git directory is always skipped. When skipProfiles is true, a top-level profiles directory is skipped as well; this is used when dir is the repository root so that profile overlays are not pulled into the base set.

func FilterPairs

func FilterPairs(pairs []Pair, homeDir string, targets []string) ([]Pair, error)

FilterPairs returns only the pairs whose destination matches one of the given targets. Targets are interpreted as home-directory paths and may use a "~/" prefix or be bare dotfile names starting with ".". Returns an error if any target cannot be matched to a pair.

func Merge

func Merge(pairs []Pair) []Pair

Merge deduplicates pairs so later entries (profile) win over earlier (base) for the same destination path.

Jump to

Keyboard shortcuts

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