diff options
| author | Danilo M. <danix@danix.xyz> | 2026-05-06 09:39:58 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-05-06 09:39:58 +0200 |
| commit | 1076091203f9387385e663ad19c7ea3648650bec (patch) | |
| tree | ce57f4dc55f03f0ca3a8102b5de6a3455105eb20 /CLAUDE.md | |
| parent | d446b2521465f11828d172209b61abcb00b18cb4 (diff) | |
| download | dots-backup-1076091203f9387385e663ad19c7ea3648650bec.tar.gz dots-backup-1076091203f9387385e663ad19c7ea3648650bec.zip | |
Add flags, config system, restore mode, and updated docs
- Add -n/--dry-run, -v/--verbose, -r/--restore, -q/--quiet flags
- Auto-commit after backup with timestamp message
- Load ~/.config/dot-backup/config for overriding defaults
- Load extra dotfiles from ~/.config/dot-backup/files.list
- Quiet mode redirects all output to ~/.local/share/dot-backup/backup.log
- Add config.example, CLAUDE.md, and updated README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..c55bd86 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,36 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## What This Is + +Single-script dotfile backup tool. `dot-backup.sh` copies files from `DOTFILES` array to a local git repo (`~/Programming/GIT/my-dotfiles`), split into `home/` and `system/` subdirectories, then stages everything with `git add`. + +## Running + +```bash +./dot-backup.sh +``` + +No build step. No tests. No deps beyond bash + rsync + git. + +## Architecture + +`dot-backup.sh` does three things in sequence: + +1. **Setup** — ensures `$DEFAULT_OUTPUT_DIR` exists with `home/` and `system/` subdirs; initializes git if needed; writes `lastupdate` timestamp +2. **Copy loop** — iterates `DOTFILES` array; paths starting with `/` go to `system/`, all others go to `home/`; uses `rsync -a` for both files and directories +3. **Stage** — `git add .` in `$DEFAULT_OUTPUT_DIR`; user must commit/push manually + +## Key Variables + +| Variable | Default | Purpose | +|---|---|---| +| `DEFAULT_OUTPUT_DIR` | `~/Programming/GIT/my-dotfiles` | Where backups land | +| `DOTFILES` | array in script | What gets backed up | + +To change backup destination, edit `DEFAULT_OUTPUT_DIR` at the top of the script. A commented-out `/tmp/` alternative is already there for testing. + +## Adding Dotfiles + +Add paths to the `DOTFILES` array. Relative paths = home dir. Absolute paths (starting `/`) = system files (copied preserving full path under `system/`). |
