autoyadm/README.md

2 KiB

AutoYADM

AutoYADM is a small shell utility to automate the process of managing dotfiles with YADM by allowing the user to define a list of files & directories to be automatically added, committed and pushed whenever the script is run. Most notably, AutoYADM accounts for newly created files previously untracked by YADM.

Installation

Simply clone the repository:

git clone git@github.com:ficcdaf/autoyadm.git

You may consider adding aliases to your shell configuration:

alias autoyadm="/path/to/autoyadm/autoyadm.sh"
alias yadmadd="/path/to/autoyadm/yadmadd.sh"
Click to see dependencies
  • YADM
  • git
  • Bash/Zsh
  • openssh (optional)

Usage

Note: The following assumes you have created shell aliases to the two scripts. You may, of course, simply call them directly.

Tracking

AutoYADM maintains a list of files and directories for automatic tracking. All children of tracked directories will be tracked, including newly created, previously untracked files. For example, if you add your Neovim configuration at ~/.config/nvim to tracking, then any new files you create inside that folder will automatically be added and committed by AutoYADM.

Both scripts and the tracking file must be in the same directory.

The tracking file contains the paths to tracked files & directories relative to $HOME. For example:

.bashrc
.config/nvim

To add paths to be tracked, you may use yadmadd.sh. Any valid absolute or relative path should work.

$ yadmadd ~/.bashrc
$ yadmadd /home/username/.bashrc
# Relative paths work too.
$ yadmadd ../../.bashrc
# You may supply any number of paths as arguments.
$ yadmadd .bashrc .zshrc .config/nvim

To remove a target from tracking, simply delete it from the tracking file.

Committing & Pushing

To automatically commit and add your tracking targets, use autoyadm.sh:

$ autoyadm

By default,