cmd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: GPL-3.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmd provides the CLI commands for dotlink.

dotlink is a dotfile symlink manager. It scans a root directory for dotlink.yaml manifests and creates symbolic links as configured.

Environment Variables

DOTLINK_ROOT  Root directory to scan for dotlink.yaml files.
              Defaults to $HOME/.custom

Examples

dotlink sync
dotlink list
dotlink status
dotlink config
dotlink new ~/.dotfiles/nvim

Index

Constants

This section is empty.

Variables

View Source
var (
	// DryRun controls whether sync actually writes symlinks.
	DryRun bool
)

Functions

func DotlinkRoot

func DotlinkRoot() string

DotlinkRoot returns the effective DOTLINK_ROOT directory.

func Execute

func Execute()

Execute runs the root command. Call this from main.

func ExpandPath

func ExpandPath(path string) (string, error)

ExpandPath expands environment variables in a path

func GetConfigDir

func GetConfigDir(configPath string) string

GetConfigDir returns the directory containing the config file

Types

type DotlinkConfig

type DotlinkConfig struct {
	Link  LinkConfig `yaml:"link"`
	Files []FileLink `yaml:"files"`
}

DotlinkConfig represents the entire dotlink.yaml configuration

func LoadConfig

func LoadConfig(filepath string) (*DotlinkConfig, error)

LoadConfig reads and parses a dotlink.yaml file

type FileLink struct {
	File string `yaml:"file"`
	To   string `yaml:"to"`
}

FileLink represents a single file link configuration

type LinkConfig

type LinkConfig struct {
	To string `yaml:"to"`
}

LinkConfig represents the link section of the config

type Linker

type Linker struct {
	// contains filtered or unexported fields
}

Linker handles the creation of symbolic links

func NewLinker

func NewLinker(dryRun bool) *Linker

NewLinker creates a new Linker instance

func (*Linker) LinkDirectory

func (l *Linker) LinkDirectory(configDir, targetPath string) error

LinkDirectory creates a symbolic link from the config directory to the target

func (*Linker) LinkFile

func (l *Linker) LinkFile(configDir, sourceFile, targetPath string) error

LinkFile creates a symbolic link for a single file

func (*Linker) ProcessConfig

func (l *Linker) ProcessConfig(configPath string) error

ProcessConfig processes a dotlink configuration

Jump to

Keyboard shortcuts

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