Skip to content

aryzing/dotz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotz

Copies a file tree from a source directory to a destination directory. It is intended for restoring dotfiles and other configuration files from a Git repository.

Arguments must be absolute or relative paths. dotz does not expand shell syntax such as a quoted ~; use $HOME or let the shell expand an unquoted ~.

Usage

dotz [--config /path/to/dotz.yaml] "$SOURCE" "$DEST"

For example, if a dotfiles repository stores the home-directory tree under home/:

dotz "$HOME/w/aryzing/dotfiles/home" "$HOME"

Existing destination files are moved to a timestamped backup such as config.toml.bak.1750000000. Source files are copied, not hard-linked, so later edits to either file do not modify the other.

Variable substitution

dotz looks for dotz.yaml beside the source directory. For a source at /path/to/dotfiles/home, the default config path is /path/to/dotfiles/dotz.yaml.

variables:
  ssh-pubkey: ssh-ed25519 AAAA... example-comment

Configured values replace matching placeholders while files are copied:

signingkey = {{ ssh-pubkey }}

Whitespace inside a placeholder is optional. Placeholders without a matching variable are preserved, allowing application-specific templates such as {{branchName}} to pass through unchanged.

Use --config (or -c) when the config is elsewhere:

dotz --config "$HOME/.config/dotz/work.yaml" \
  "$HOME/w/aryzing/dotfiles/home" \
  "$HOME"

An explicitly selected config must exist. If the default sibling dotz.yaml does not exist, files are copied without substitutions.

About

Copy dotfiles and other config files to target location while keeping source hierarchy

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages